Class: ResponseHash
- Inherits:
-
Hash
- Object
- Hash
- ResponseHash
- Defined in:
- lib/oauth2/response_hash.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(response) ⇒ ResponseHash
constructor
A new instance of ResponseHash.
- #status ⇒ Object
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
#response ⇒ Object
Returns the value of attribute response.
9 10 11 |
# File 'lib/oauth2/response_hash.rb', line 9 def response @response end |
Instance Method Details
#headers ⇒ Object
12 |
# File 'lib/oauth2/response_hash.rb', line 12 def headers; response.headers end |
#status ⇒ Object
11 |
# File 'lib/oauth2/response_hash.rb', line 11 def status; response.status end |