Class: DwollaV2::TokenWrapper
- Inherits:
-
Object
- Object
- DwollaV2::TokenWrapper
- Defined in:
- lib/dwolla_v2/token_manager.rb
Constant Summary collapse
- EXPIRES_IN_LEEWAY =
60
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ TokenWrapper
constructor
A new instance of TokenWrapper.
- #is_expired? ⇒ Boolean
Constructor Details
#initialize(token) ⇒ TokenWrapper
Returns a new instance of TokenWrapper.
30 31 32 33 |
# File 'lib/dwolla_v2/token_manager.rb', line 30 def initialize(token) @token = token @expires_at = Time.now.utc + @token.expires_in - EXPIRES_IN_LEEWAY end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
28 29 30 |
# File 'lib/dwolla_v2/token_manager.rb', line 28 def token @token end |
Instance Method Details
#is_expired? ⇒ Boolean
35 36 37 |
# File 'lib/dwolla_v2/token_manager.rb', line 35 def is_expired? @expires_at < Time.now.utc end |