Class: ResponseHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/oauth2/response_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseHash

Returns a new instance of ResponseHash.



2
3
4
5
6
7
# File 'lib/oauth2/response_hash.rb', line 2

def initialize(response)
  self.response = response
  
  body = MultiJson.decode(response.body)
  body.keys.each{|k| self[k] = body[k]}
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/oauth2/response_hash.rb', line 9

def response
  @response
end

Instance Method Details

#headersObject



12
# File 'lib/oauth2/response_hash.rb', line 12

def headers; response.headers end

#statusObject



11
# File 'lib/oauth2/response_hash.rb', line 11

def status; response.status end