Class: Stormpath::Rails::AccountFromAccessToken
- Inherits:
-
Object
- Object
- Stormpath::Rails::AccountFromAccessToken
- Defined in:
- app/services/stormpath/rails/account_from_access_token.rb
Constant Summary collapse
- NoAccessToken =
Class.new(ArgumentError)
- AuthenticationWithRefreshTokenAttemptError =
Class.new(ArgumentError)
- DifferentIssuerError =
Class.new(ArgumentError)
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #account ⇒ Object
-
#initialize(access_token) ⇒ AccountFromAccessToken
constructor
A new instance of AccountFromAccessToken.
Constructor Details
#initialize(access_token) ⇒ AccountFromAccessToken
Returns a new instance of AccountFromAccessToken.
10 11 12 13 |
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 10 def initialize(access_token) raise(NoAccessToken) if access_token.blank? @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
4 5 6 |
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 4 def access_token @access_token end |
Instance Method Details
#account ⇒ Object
15 16 17 |
# File 'app/services/stormpath/rails/account_from_access_token.rb', line 15 def account @account ||= resolution_instance.verify(access_token).account end |