Class: Cerner::OAuth1a::Cache::KeysEntry
- Inherits:
-
Object
- Object
- Cerner::OAuth1a::Cache::KeysEntry
- Defined in:
- lib/cerner/oauth1a/cache.rb
Overview
Internal: A cache entry class for Keys values.
Instance Attribute Summary collapse
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#expired?(now) ⇒ Boolean
Internal: Check if the entry is expired.
-
#initialize(keys, expires_in) ⇒ KeysEntry
constructor
Internal: Constructs an instance.
Constructor Details
#initialize(keys, expires_in) ⇒ KeysEntry
Internal: Constructs an instance.
31 32 33 34 35 |
# File 'lib/cerner/oauth1a/cache.rb', line 31 def initialize(keys, expires_in) @value = keys @expires_in = expires_in @expires_at = Time.now.utc.to_i + @expires_in end |
Instance Attribute Details
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
28 29 30 |
# File 'lib/cerner/oauth1a/cache.rb', line 28 def expires_in @expires_in end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
27 28 29 |
# File 'lib/cerner/oauth1a/cache.rb', line 27 def value @value end |
Instance Method Details
#expired?(now) ⇒ Boolean
Internal: Check if the entry is expired.
38 39 40 |
# File 'lib/cerner/oauth1a/cache.rb', line 38 def expired?(now) @expires_at <= now end |