Class: Responses::RestResponse
- Inherits:
-
BaseResponse
- Object
- BaseResponse
- Responses::RestResponse
- Defined in:
- lib/nasa/utils/responses.rb
Overview
Handles and parses non error responses from the API
Instance Attribute Summary
Attributes inherited from BaseResponse
#body, #code, #headers, #message, #raw_response, #remaining_requests
Instance Method Summary collapse
-
#initialize(response) ⇒ RestResponse
constructor
A new instance of RestResponse.
-
#parse_response(response) ⇒ Object
Parses response from successful API calls.
Methods inherited from BaseResponse
Constructor Details
#initialize(response) ⇒ RestResponse
Returns a new instance of RestResponse
52 53 54 |
# File 'lib/nasa/utils/responses.rb', line 52 def initialize(response) super(response) end |
Instance Method Details
#parse_response(response) ⇒ Object
Parses response from successful API calls
59 60 61 62 63 64 |
# File 'lib/nasa/utils/responses.rb', line 59 def parse_response(response) @code = response.code @body = json_parse(response.body) @headers = response.headers @remaining_requests = @headers[:x_ratelimit_remaining] end |