Class: Marver::API::Response
- Inherits:
-
Object
- Object
- Marver::API::Response
- Defined in:
- lib/marver/api/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(raw_json) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(raw_json) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 |
# File 'lib/marver/api/response.rb', line 8 def initialize(raw_json) json = JSON.parse(raw_json) @code = json['code'].to_i @status = json['status'] @data = json['data'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/marver/api/response.rb', line 6 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/marver/api/response.rb', line 6 def data @data end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
6 7 8 |
# File 'lib/marver/api/response.rb', line 6 def results @results end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/marver/api/response.rb', line 6 def status @status end |