Class: Keybase::Response
- Inherits:
-
Object
- Object
- Keybase::Response
- Defined in:
- lib/keybase/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#cookie ⇒ Object
readonly
Returns the value of attribute cookie.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(server_response) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 |
# File 'lib/keybase/response.rb', line 7 def initialize(server_response) @body = JSON.parse(server_response.body) Error.raise_unless_successful(@body['status']) = server_response.headers['Set-Cookie'] ? server_response.headers['Set-Cookie'] : nil end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/keybase/response.rb', line 5 def body @body end |
#cookie ⇒ Object (readonly)
Returns the value of attribute cookie.
5 6 7 |
# File 'lib/keybase/response.rb', line 5 def end |