Class: DBots::API::Response
- Inherits:
-
Object
- Object
- DBots::API::Response
- Defined in:
- lib/dbots/api.rb
Overview
The nested response from rest-client
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
The HTTP response body.
-
#code ⇒ Integer
(also: #status)
readonly
HTTP status code.
-
#cookies ⇒ Hash
readonly
Cookie jar extracted from response headers.
-
#headers ⇒ Hash
readonly
A hash of the headers, beautified with symbols and underscores.
-
#json ⇒ Hash?
readonly
The parsed JSON of the response.
-
#raw ⇒ RestClient::Response
readonly
The raw response given from rest-client.
Instance Attribute Details
#body ⇒ String (readonly)
Returns the HTTP response body.
46 47 48 |
# File 'lib/dbots/api.rb', line 46 def body @body end |
#code ⇒ Integer (readonly) Also known as: status
Returns HTTP status code.
49 50 51 |
# File 'lib/dbots/api.rb', line 49 def code @code end |
#cookies ⇒ Hash (readonly)
Returns cookie jar extracted from response headers.
56 57 58 |
# File 'lib/dbots/api.rb', line 56 def @cookies end |
#headers ⇒ Hash (readonly)
Returns a hash of the headers, beautified with symbols and underscores.
53 54 55 |
# File 'lib/dbots/api.rb', line 53 def headers @headers end |
#json ⇒ Hash? (readonly)
Returns the parsed JSON of the response.
59 60 61 |
# File 'lib/dbots/api.rb', line 59 def json @json end |
#raw ⇒ RestClient::Response (readonly)
Returns the raw response given from rest-client.
62 63 64 |
# File 'lib/dbots/api.rb', line 62 def raw @raw end |