Class: Aws::LRUCache::Entry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/lru_cache.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Entry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Entry.



59
60
61
62
63
# File 'lib/aws-sdk-core/lru_cache.rb', line 59

def initialize(options = {})
  @value = options[:value]
  @expiration = options[:expiration]
  @created_time = Time.now
end

Instance Attribute Details

#valueObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Object)


66
67
68
# File 'lib/aws-sdk-core/lru_cache.rb', line 66

def value
  @value
end

Instance Method Details

#expired?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


68
69
70
71
72
# File 'lib/aws-sdk-core/lru_cache.rb', line 68

def expired?
  return false unless @expiration

  Time.now - @created_time > @expiration
end