Module: ThinkificRuby::ResourceHelper

Included in:
CourseReview
Defined in:
lib/thinkific_ruby/resource_helper.rb

Instance Method Summary collapse

Instance Method Details

#raise_error_if_response_status_not_200_or_return_parsed_response(response_status, parsed_response_body) ⇒ Object



14
15
16
17
18
19
# File 'lib/thinkific_ruby/resource_helper.rb', line 14

def raise_error_if_response_status_not_200_or_return_parsed_response(response_status, parsed_response_body)
  unless response_status == 200
    raise ThinkificRuby::ApiError.new(response_status, parsed_response_body)
  end
  parsed_response_body
end

#raise_input_error_if_not_natural_number(id) ⇒ Object



7
8
9
10
11
12
# File 'lib/thinkific_ruby/resource_helper.rb', line 7

def raise_input_error_if_not_natural_number(id)
  
  if id <= 0
    raise ThinkificRuby::InputError
  end
end