Class: Analysand::ConfigResponse
- Inherits:
-
Object
- Object
- Analysand::ConfigResponse
- Includes:
- ResponseHeaders, StatusCodePredicates
- Defined in:
- lib/analysand/config_response.rb
Overview
Public: Wraps responses from /_config.
GET/PUT/DELETE /_config does not return a valid JSON object in all cases. This response object therefore does The Simplest Possible Thing and just gives you back the response body as a string.
Instance Attribute Summary collapse
-
#body ⇒ Object
(also: #value)
readonly
Returns the value of attribute body.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ ConfigResponse
constructor
A new instance of ConfigResponse.
Methods included from StatusCodePredicates
#code, #conflict?, #not_found?, #success?, #unauthorized?
Methods included from ResponseHeaders
#cookies, #etag, #session_cookie
Constructor Details
#initialize(response) ⇒ ConfigResponse
Returns a new instance of ConfigResponse.
18 19 20 21 |
# File 'lib/analysand/config_response.rb', line 18 def initialize(response) @response = response @body = response.body.chomp end |
Instance Attribute Details
#body ⇒ Object (readonly) Also known as: value
Returns the value of attribute body.
14 15 16 |
# File 'lib/analysand/config_response.rb', line 14 def body @body end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
13 14 15 |
# File 'lib/analysand/config_response.rb', line 13 def response @response end |