Class: ArkEcosystem::Client::HTTP::Response
- Inherits:
-
Object
- Object
- ArkEcosystem::Client::HTTP::Response
- Defined in:
- lib/arkecosystem/client/http/response.rb
Overview
The HTTP response returned by the client.
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #to_hash ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
10 11 12 |
# File 'lib/arkecosystem/client/http/response.rb', line 10 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
8 9 10 |
# File 'lib/arkecosystem/client/http/response.rb', line 8 def response @response end |
Instance Method Details
#body ⇒ Object
14 15 16 |
# File 'lib/arkecosystem/client/http/response.rb', line 14 def body JSON.parse(@response.body) end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/arkecosystem/client/http/response.rb', line 22 def to_hash @response.to_hash end |
#url ⇒ Object
18 19 20 |
# File 'lib/arkecosystem/client/http/response.rb', line 18 def url @response.to_hash[:url].to_s end |