Class: ResponseString

Inherits:
String
  • Object
show all
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

Instance Method Summary collapse

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

#responseObject

Returns the value of attribute response.



11
12
13
# File 'lib/oauth2/response_string.rb', line 11

def response
  @response
end

Instance Method Details

#headersObject



14
# File 'lib/oauth2/response_string.rb', line 14

def headers; response.headers end

#statusObject



13
# File 'lib/oauth2/response_string.rb', line 13

def status; response.status end