Class: Rospatent::Cache::CacheEntry
- Inherits:
-
Struct
- Object
- Struct
- Rospatent::Cache::CacheEntry
- Defined in:
- lib/rospatent/cache.rb
Overview
Cache entry with value and expiration time
Instance Attribute Summary collapse
-
#access_count ⇒ Object
Returns the value of attribute access_count.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#access_count ⇒ Object
Returns the value of attribute access_count
11 12 13 |
# File 'lib/rospatent/cache.rb', line 11 def access_count @access_count end |
#created_at ⇒ Object
Returns the value of attribute created_at
11 12 13 |
# File 'lib/rospatent/cache.rb', line 11 def created_at @created_at end |
#expires_at ⇒ Object
Returns the value of attribute expires_at
11 12 13 |
# File 'lib/rospatent/cache.rb', line 11 def expires_at @expires_at end |
#value ⇒ Object
Returns the value of attribute value
11 12 13 |
# File 'lib/rospatent/cache.rb', line 11 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
12 13 14 |
# File 'lib/rospatent/cache.rb', line 12 def expired? Time.now > expires_at end |
#touch! ⇒ Object
16 17 18 |
# File 'lib/rospatent/cache.rb', line 16 def touch! self.access_count += 1 end |