Class: Fire::Connection::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/connection/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response, path) ⇒ Response

Returns a new instance of Response.



9
10
11
12
13
# File 'lib/connection/response.rb', line 9

def initialize(raw_response, path)
  @raw_response = raw_response
  @path = path
  Fire.logger.response(@raw_response, path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/connection/response.rb', line 6

def path
  @path
end

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



6
7
8
# File 'lib/connection/response.rb', line 6

def raw_response
  @raw_response
end

Instance Method Details

#bodyObject



15
16
17
# File 'lib/connection/response.rb', line 15

def body
  JSON.parse(raw_response.body, :quirks_mode => true)
end