Class: CLXRestAPI::Response
- Inherits:
-
Object
- Object
- CLXRestAPI::Response
- Defined in:
- lib/clx_rest_api/response.rb
Instance Attribute Summary collapse
-
#original_response ⇒ Object
readonly
Returns the value of attribute original_response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(original_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(original_response) ⇒ Response
5 6 7 |
# File 'lib/clx_rest_api/response.rb', line 5 def initialize(original_response) @original_response = original_response end |
Instance Attribute Details
#original_response ⇒ Object (readonly)
Returns the value of attribute original_response.
3 4 5 |
# File 'lib/clx_rest_api/response.rb', line 3 def original_response @original_response end |
Instance Method Details
#body ⇒ Object
9 10 11 12 13 |
# File 'lib/clx_rest_api/response.rb', line 9 def body JSON.parse(@original_response.body) rescue JSON::ParserError {} end |