Class: Keybase::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/keybase/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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'])
  @cookie = server_response.headers['Set-Cookie'] ? server_response.headers['Set-Cookie'] : nil
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/keybase/response.rb', line 5

def body
  @body
end

Returns the value of attribute cookie.



5
6
7
# File 'lib/keybase/response.rb', line 5

def cookie
  @cookie
end