Class: Cameraplus::API::Request
- Inherits:
-
Object
- Object
- Cameraplus::API::Request
- Includes:
- HTTParty
- Defined in:
- lib/cameraplus/api/request.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Request
constructor
A new instance of Request.
- #parsed_response ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Request
Returns a new instance of Request.
12 13 14 15 |
# File 'lib/cameraplus/api/request.rb', line 12 def initialize(url, = {}) @url = url @options = end |
Class Method Details
.call(url, options = {}) ⇒ Object
8 9 10 |
# File 'lib/cameraplus/api/request.rb', line 8 def self.call(url, = {}) new(url, ).parsed_response end |
Instance Method Details
#parsed_response ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cameraplus/api/request.rb', line 17 def parsed_response if code == 200 @response.parsed_response else raise InvalidResponseError, end end |