Class: Capcoauth::OAuth::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/capcoauth/oauth/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ AccessToken

Returns a new instance of AccessToken.



7
8
9
10
# File 'lib/capcoauth/oauth/access_token.rb', line 7

def initialize(token)
  @token = token
  @user_id = TTLCache.user_id_for(token)
end

Instance Attribute Details

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/capcoauth/oauth/access_token.rb', line 4

def token
  @token
end

#user_idObject

Returns the value of attribute user_id.



5
6
7
# File 'lib/capcoauth/oauth/access_token.rb', line 5

def user_id
  @user_id
end

Instance Method Details

#verifyObject



12
13
14
# File 'lib/capcoauth/oauth/access_token.rb', line 12

def verify
  TokenVerifier.verify(self)
end