Class: OAuth2::TokenResponse
- Inherits:
-
Object
- Object
- OAuth2::TokenResponse
- Defined in:
- lib/oauth20/token_response.rb
Instance Method Summary collapse
-
#initialize(request) ⇒ TokenResponse
constructor
A new instance of TokenResponse.
- #to_json ⇒ Object
Constructor Details
#initialize(request) ⇒ TokenResponse
Returns a new instance of TokenResponse.
3 4 5 6 7 |
# File 'lib/oauth20/token_response.rb', line 3 def initialize(request) @access_token = AccessToken.new({:client_key => request.client.key, :user_id => request.user_id}) @access_token.save request.code.invalidate(@access_token) end |
Instance Method Details
#to_json ⇒ Object
9 10 11 |
# File 'lib/oauth20/token_response.rb', line 9 def to_json @access_token.to_json end |