Class: Kameleoon::Network::ExpiringToken
- Inherits:
-
Object
- Object
- Kameleoon::Network::ExpiringToken
- Defined in:
- lib/kameleoon/network/access_token_source.rb
Instance Attribute Summary collapse
-
#expiration_time ⇒ Object
readonly
Returns the value of attribute expiration_time.
-
#obsolescence_time ⇒ Object
readonly
Returns the value of attribute obsolescence_time.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #expired?(now) ⇒ Boolean
-
#initialize(value, expiration_time, obsolescence_time) ⇒ ExpiringToken
constructor
A new instance of ExpiringToken.
- #obsolete?(now) ⇒ Boolean
Constructor Details
#initialize(value, expiration_time, obsolescence_time) ⇒ ExpiringToken
Returns a new instance of ExpiringToken.
206 207 208 209 210 |
# File 'lib/kameleoon/network/access_token_source.rb', line 206 def initialize(value, expiration_time, obsolescence_time) @value = value @expiration_time = expiration_time @obsolescence_time = obsolescence_time end |
Instance Attribute Details
#expiration_time ⇒ Object (readonly)
Returns the value of attribute expiration_time.
204 205 206 |
# File 'lib/kameleoon/network/access_token_source.rb', line 204 def expiration_time @expiration_time end |
#obsolescence_time ⇒ Object (readonly)
Returns the value of attribute obsolescence_time.
204 205 206 |
# File 'lib/kameleoon/network/access_token_source.rb', line 204 def obsolescence_time @obsolescence_time end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
204 205 206 |
# File 'lib/kameleoon/network/access_token_source.rb', line 204 def value @value end |
Instance Method Details
#expired?(now) ⇒ Boolean
212 213 214 |
# File 'lib/kameleoon/network/access_token_source.rb', line 212 def expired?(now) now >= @expiration_time end |
#obsolete?(now) ⇒ Boolean
216 217 218 |
# File 'lib/kameleoon/network/access_token_source.rb', line 216 def obsolete?(now) now >= @obsolescence_time end |