Class: PFS::Resources::Authentication::Token
- Defined in:
- lib/pfs/resources/authentication/token.rb
Instance Attribute Summary collapse
-
#accessToken ⇒ Object
(also: #access_token)
Returns the value of attribute accessToken.
-
#expiresIn ⇒ Object
(also: #expires_in)
Returns the value of attribute expiresIn.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(response, attributes = {}) ⇒ Token
constructor
A new instance of Token.
- #valid? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(response, attributes = {}) ⇒ Token
Returns a new instance of Token.
13 14 15 16 |
# File 'lib/pfs/resources/authentication/token.rb', line 13 def initialize(response, attributes = {}) super(response, attributes) @expires_on = Time.now + expires_in end |
Instance Attribute Details
#accessToken ⇒ Object Also known as: access_token
Returns the value of attribute accessToken.
7 8 9 |
# File 'lib/pfs/resources/authentication/token.rb', line 7 def accessToken @accessToken end |
#expiresIn ⇒ Object Also known as: expires_in
Returns the value of attribute expiresIn.
7 8 9 |
# File 'lib/pfs/resources/authentication/token.rb', line 7 def expiresIn @expiresIn end |
Instance Method Details
#valid? ⇒ Boolean
18 19 20 |
# File 'lib/pfs/resources/authentication/token.rb', line 18 def valid? @expires_on > Time.now end |