Class: ResponseString
- Inherits:
-
String
- Object
- String
- ResponseString
- Defined in:
- lib/oauth2/response_string.rb
Overview
This special String class is returned from HTTP requests and contains the original full response along with convenience methods for accessing the HTTP status code and headers. It is returned from all access token requests.
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(response) ⇒ ResponseString
constructor
A new instance of ResponseString.
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ ResponseString
Returns a new instance of ResponseString.
6 7 8 9 |
# File 'lib/oauth2/response_string.rb', line 6 def initialize(response) super(response.body) self.response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
11 12 13 |
# File 'lib/oauth2/response_string.rb', line 11 def response @response end |
Instance Method Details
#headers ⇒ Object
17 18 19 |
# File 'lib/oauth2/response_string.rb', line 17 def headers response.headers end |
#status ⇒ Object
13 14 15 |
# File 'lib/oauth2/response_string.rb', line 13 def status response.status end |