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