Class: Cerner::OAuth1a::Cache::AccessTokenEntry
- Inherits:
-
Object
- Object
- Cerner::OAuth1a::Cache::AccessTokenEntry
- Defined in:
- lib/cerner/oauth1a/cache.rb
Overview
Internal: A cache entry class for AccessToken values.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#expired?(now) ⇒ Boolean
Internal: Check if the entry is expired.
-
#expires_in ⇒ Object
Internal: Returns the number of seconds until the entry expires.
-
#initialize(access_token) ⇒ AccessTokenEntry
constructor
Internal: Constructs an instance.
Constructor Details
#initialize(access_token) ⇒ AccessTokenEntry
Internal: Constructs an instance.
48 49 50 |
# File 'lib/cerner/oauth1a/cache.rb', line 48 def initialize(access_token) @value = access_token end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
45 46 47 |
# File 'lib/cerner/oauth1a/cache.rb', line 45 def value @value end |
Instance Method Details
#expired?(now) ⇒ Boolean
Internal: Check if the entry is expired.
58 59 60 |
# File 'lib/cerner/oauth1a/cache.rb', line 58 def expired?(now) @value.expired?(now: now) end |
#expires_in ⇒ Object
Internal: Returns the number of seconds until the entry expires.
53 54 55 |
# File 'lib/cerner/oauth1a/cache.rb', line 53 def expires_in @value.expires_at.to_i - Time.now.utc.to_i end |