Class: Cerner::OAuth1a::Cache::AccessTokenEntry

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

Overview

Internal: A cache entry class for AccessToken values.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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

Returns:

  • (Boolean)


58
59
60
# File 'lib/cerner/oauth1a/cache.rb', line 58

def expired?(now)
  @value.expired?(now: now)
end

#expires_inObject

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