Class: Cerner::OAuth1a::Cache::KeysEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/cerner/oauth1a/cache.rb

Overview

Internal: A cache entry class for Keys values.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_inObject (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

#valueObject (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.

Returns:

  • (Boolean)


38
39
40
# File 'lib/cerner/oauth1a/cache.rb', line 38

def expired?(now)
  @expires_at <= now
end