class Delphix::Response

Attributes

body[R]

@!attribute [r] method

The parsed response body where applicable (JSON responses are parsed
to Objects/Associative Arrays).
@return [#body]
code[R]

@!attribute [r] code

The HTTP response code from Delphix engine.
@return [#code]
cookies[R]

@!attribute [r] method

The current session cookies.
@return [#raw_body]
headers[R]

@!attribute [r] method

The HTTP headers, symbolized and underscored.
@return [#headers]
raw_body[R]

@!attribute [r] method

The raw_body un-parsed response body from the Delphix engine.
@return [#raw_body]

Public Class Methods

new(response) click to toggle source
# File lib/delphix/response.rb, line 46
def initialize(response)
  @code = response.code
  @headers = response.headers
  @raw_body = response
  @body = @raw_body
  @cookies = response.cookies

  Delphix.last_response = {
    code: response.code,
    headers: response.headers,
    body: Hashie::Mash.new(JSON.parse(response.body)),
    cookies: response.cookies,
    description: response.description
  }
  begin
    @body = Hashie::Mash.new(JSON.parse(@raw_body))
  rescue Exception
  end
end