module LearnWeb::Client::Lesson

Public Instance Methods

current_lesson() click to toggle source
# File lib/learn_web/client/lesson.rb, line 20
def current_lesson
  response = get(
    current_lesson_endpoint,
    headers: { 'Authorization' => "Bearer #{token}" }
  )

  LearnWeb::Client::Lesson::CurrentLesson.new(response)
end
current_lesson_endpoint() click to toggle source
# File lib/learn_web/client/lesson.rb, line 8
def current_lesson_endpoint
  "#{API_ROOT}/users/current_lesson"
end
current_status() click to toggle source
# File lib/learn_web/client/lesson.rb, line 39
def current_status
  response = get(
    current_status_endpoint,
    headers: { 'Authorization' => "Bearer #{token}" }
  )

  LearnWeb::Client::Lesson::CurrentStatus.new(response)
end
current_status_endpoint() click to toggle source
# File lib/learn_web/client/lesson.rb, line 16
def current_status_endpoint
  "#{API_ROOT}/users/current_lesson/status"
end
next_lesson() click to toggle source
# File lib/learn_web/client/lesson.rb, line 29
def next_lesson
  response = get(
    next_lesson_endpoint,
    headers: { 'Authorization' => "Bearer #{token}" },
    params: { 'dir_name' => File.basename(FileUtils.pwd) }
  )

  LearnWeb::Client::Lesson::NextLesson.new(response)
end
next_lesson_endpoint() click to toggle source
# File lib/learn_web/client/lesson.rb, line 12
def next_lesson_endpoint
  "#{API_ROOT}/users/next_lesson"
end