Class: Analysand::ConfigResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#bodyObject (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

#responseObject (readonly)

Returns the value of attribute response.



13
14
15
# File 'lib/analysand/config_response.rb', line 13

def response
  @response
end