Class: Alloy::KYC::BearerToken
- Inherits:
-
Object
- Object
- Alloy::KYC::BearerToken
- Defined in:
- lib/alloy/kyc/bearer_token.rb
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(access_token, expires_in) ⇒ BearerToken
constructor
A new instance of BearerToken.
Constructor Details
#initialize(access_token, expires_in) ⇒ BearerToken
Returns a new instance of BearerToken.
6 7 8 9 |
# File 'lib/alloy/kyc/bearer_token.rb', line 6 def initialize(access_token, expires_in) @token = access_token @expires_at = Time.now + expires_in end |
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
4 5 6 |
# File 'lib/alloy/kyc/bearer_token.rb', line 4 def expires_at @expires_at end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/alloy/kyc/bearer_token.rb', line 4 def token @token end |
Instance Method Details
#expired? ⇒ Boolean
11 12 13 |
# File 'lib/alloy/kyc/bearer_token.rb', line 11 def expired? Time.now > expires_at end |