Class: Elements::ElementsResponse
- Inherits:
-
Object
- Object
- Elements::ElementsResponse
- Defined in:
- lib/elements/elements_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(http_resp) ⇒ ElementsResponse
constructor
A new instance of ElementsResponse.
Constructor Details
#initialize(http_resp) ⇒ ElementsResponse
Returns a new instance of ElementsResponse.
7 8 9 10 11 12 |
# File 'lib/elements/elements_response.rb', line 7 def initialize(http_resp) @body = http_resp.body @headers = http_resp.headers @status = http_resp.code @data = JSON.parse(http_resp.body, symbolize_names: true) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/elements/elements_response.rb', line 5 def body @body end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/elements/elements_response.rb', line 5 def data @data end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/elements/elements_response.rb', line 5 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/elements/elements_response.rb', line 5 def status @status end |