Class: Moodle::Api::Request
- Inherits:
-
Object
- Object
- Moodle::Api::Request
- Defined in:
- lib/moodle/api/request.rb
Overview
Handles making the request to the Moodle API and interpreting the results. The Moodle API is not consistent in the way it returns responses so the type of response is determined, successful responses are returned, failures are parsed and raised in a generic fashion.
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
11 12 13 |
# File 'lib/moodle/api/request.rb', line 11 def response @response end |
Instance Method Details
#post(path, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/moodle/api/request.rb', line 13 def post(path, = {}) @response = Typhoeus.post(path, ) resolve_response if response.success? end |