Class: FinerWorks::Response
- Inherits:
-
Object
- Object
- FinerWorks::Response
- Defined in:
- lib/finerworks/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#json ⇒ Object
Returns the value of attribute json.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
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. @body = http_response.body @json = JSON.parse(@body) if http_response.is_a? Net::HTTPOK end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/finerworks/response.rb', line 5 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
5 6 7 |
# File 'lib/finerworks/response.rb', line 5 def code @code end |
#json ⇒ Object
Returns the value of attribute json.
5 6 7 |
# File 'lib/finerworks/response.rb', line 5 def json @json end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/finerworks/response.rb', line 5 def @message end |