Class: SoftEvictCache::SingleValueCache::Entry
- Inherits:
-
Struct
- Object
- Struct
- SoftEvictCache::SingleValueCache::Entry
- Defined in:
- lib/soft_evict_cache/single_value_cache.rb
Instance Attribute Summary collapse
-
#hard_evict_at ⇒ Object
Returns the value of attribute hard_evict_at.
-
#soft_evict_at ⇒ Object
Returns the value of attribute soft_evict_at.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#hard_evict_at ⇒ Object
Returns the value of attribute hard_evict_at
9 10 11 |
# File 'lib/soft_evict_cache/single_value_cache.rb', line 9 def hard_evict_at @hard_evict_at end |
#soft_evict_at ⇒ Object
Returns the value of attribute soft_evict_at
9 10 11 |
# File 'lib/soft_evict_cache/single_value_cache.rb', line 9 def soft_evict_at @soft_evict_at end |
#value ⇒ Object
Returns the value of attribute value
9 10 11 |
# File 'lib/soft_evict_cache/single_value_cache.rb', line 9 def value @value end |
Instance Method Details
#soft_evicted? ⇒ Boolean
10 11 12 |
# File 'lib/soft_evict_cache/single_value_cache.rb', line 10 def soft_evicted? soft_evict_at < Time.now end |
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/soft_evict_cache/single_value_cache.rb', line 14 def valid? Time.now < hard_evict_at end |