Class: Rack::OAuth2::AccessToken::Legacy
- Inherits:
-
Rack::OAuth2::AccessToken
- Object
- Rack::OAuth2::AccessToken
- Rack::OAuth2::AccessToken::Legacy
- Defined in:
- lib/rack/oauth2/access_token/legacy.rb
Instance Method Summary collapse
- #authenticate(request) ⇒ Object
-
#initialize(attributes = {}) ⇒ Legacy
constructor
A new instance of Legacy.
-
#to_s ⇒ Object
This is for fb_graph.
Methods inherited from Rack::OAuth2::AccessToken
Constructor Details
#initialize(attributes = {}) ⇒ Legacy
Returns a new instance of Legacy.
5 6 7 8 9 10 11 |
# File 'lib/rack/oauth2/access_token/legacy.rb', line 5 def initialize(attributes = {}) super self.expires_in = ( self.expires_in || attributes[:expires] ).try(:to_i) end |
Instance Method Details
#authenticate(request) ⇒ Object
17 18 19 |
# File 'lib/rack/oauth2/access_token/legacy.rb', line 17 def authenticate(request) request.header["Authorization"] = "OAuth #{access_token}" end |
#to_s ⇒ Object
This is for fb_graph
13 14 15 |
# File 'lib/rack/oauth2/access_token/legacy.rb', line 13 def to_s # This is for fb_graph self.access_token end |