Class: FipExtractor::Response
- Inherits:
-
Object
- Object
- FipExtractor::Response
- Defined in:
- lib/fipextractor/response.rb
Direct Known Subclasses
BrandResponse, ModelResponse, ModelThroughYearResponse, ModelYearResponse, ReferenceTableResponse, VehicleResponse
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(raw) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(raw) ⇒ Response
7 8 9 10 |
# File 'lib/fipextractor/response.rb', line 7 def initialize(raw) @status = raw.status @all = JSON.parse(raw.body, symbolize_names: true) end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
5 6 7 |
# File 'lib/fipextractor/response.rb', line 5 def all @all end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/fipextractor/response.rb', line 5 def status @status end |
Instance Method Details
#error? ⇒ Boolean
12 13 14 |
# File 'lib/fipextractor/response.rb', line 12 def error? status >= 400 end |