Class: FinerWorks::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
# File 'lib/finerworks/response.rb', line 7

def initialize(http_response)
  @code = http_response.code
  @message = http_response.message
  @body = http_response.body
  @json = JSON.parse(@body) if http_response.is_a? Net::HTTPOK
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/finerworks/response.rb', line 5

def body
  @body
end

#codeObject

Returns the value of attribute code.



5
6
7
# File 'lib/finerworks/response.rb', line 5

def code
  @code
end

#jsonObject

Returns the value of attribute json.



5
6
7
# File 'lib/finerworks/response.rb', line 5

def json
  @json
end

#messageObject

Returns the value of attribute message.



5
6
7
# File 'lib/finerworks/response.rb', line 5

def message
  @message
end