Class: Doorkeeper::OAuth::TokenResponse
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::TokenResponse
- Defined in:
- lib/doorkeeper/oauth/token_response.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(token) ⇒ TokenResponse
constructor
A new instance of TokenResponse.
- #status ⇒ Object
Constructor Details
#initialize(token) ⇒ TokenResponse
Returns a new instance of TokenResponse.
6 7 8 |
# File 'lib/doorkeeper/oauth/token_response.rb', line 6 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/doorkeeper/oauth/token_response.rb', line 4 def token @token end |
Instance Method Details
#body ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/doorkeeper/oauth/token_response.rb', line 10 def body { 'access_token' => token.token, 'token_type' => token.token_type, 'expires_in' => token.expires_in, 'refresh_token' => token.refresh_token, 'scope' => token.scopes_string } end |
#headers ⇒ Object
24 25 26 |
# File 'lib/doorkeeper/oauth/token_response.rb', line 24 def headers { 'Cache-Control' => 'no-store', 'Pragma' => 'no-cache', 'Content-Type' => 'application/json; charset=utf-8' } end |
#status ⇒ Object
20 21 22 |
# File 'lib/doorkeeper/oauth/token_response.rb', line 20 def status :ok end |