Class: ArkEcosystem::Client::HTTP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/arkecosystem/client/http/response.rb

Overview

The HTTP response returned by the client.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject

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

#bodyObject



14
15
16
# File 'lib/arkecosystem/client/http/response.rb', line 14

def body
  JSON.parse(@response.body)
end

#to_hashObject



22
23
24
# File 'lib/arkecosystem/client/http/response.rb', line 22

def to_hash
  @response.to_hash
end

#urlObject



18
19
20
# File 'lib/arkecosystem/client/http/response.rb', line 18

def url
  @response.to_hash[:url].to_s
end