Class: DBots::API::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/dbots/api.rb

Overview

The nested response from rest-client

Instance Attribute Summary collapse

Instance Attribute Details

#bodyString (readonly)

Returns the HTTP response body.

Returns:

  • (String)

    the HTTP response body.



46
47
48
# File 'lib/dbots/api.rb', line 46

def body
  @body
end

#codeInteger (readonly) Also known as: status

Returns HTTP status code.

Returns:

  • (Integer)

    HTTP status code.



49
50
51
# File 'lib/dbots/api.rb', line 49

def code
  @code
end

#cookiesHash (readonly)

Returns cookie jar extracted from response headers.

Returns:

  • (Hash)

    cookie jar extracted from response headers.



56
57
58
# File 'lib/dbots/api.rb', line 56

def cookies
  @cookies
end

#headersHash (readonly)

Returns a hash of the headers, beautified with symbols and underscores.

Returns:

  • (Hash)

    a hash of the headers, beautified with symbols and underscores.



53
54
55
# File 'lib/dbots/api.rb', line 53

def headers
  @headers
end

#jsonHash? (readonly)

Returns the parsed JSON of the response.

Returns:

  • (Hash, nil)

    the parsed JSON of the response



59
60
61
# File 'lib/dbots/api.rb', line 59

def json
  @json
end

#rawRestClient::Response (readonly)

Returns the raw response given from rest-client.

Returns:

  • (RestClient::Response)

    the raw response given from rest-client



62
63
64
# File 'lib/dbots/api.rb', line 62

def raw
  @raw
end