Class: Async::Cache::Item
- Inherits:
-
Struct
- Object
- Struct
- Async::Cache::Item
- Defined in:
- lib/async/cache.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#task ⇒ Object
Returns the value of attribute task.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
4 5 6 |
# File 'lib/async/cache.rb', line 4 def created_at @created_at end |
#duration ⇒ Object
Returns the value of attribute duration
4 5 6 |
# File 'lib/async/cache.rb', line 4 def duration @duration end |
#task ⇒ Object
Returns the value of attribute task
4 5 6 |
# File 'lib/async/cache.rb', line 4 def task @task end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'lib/async/cache.rb', line 4 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
5 |
# File 'lib/async/cache.rb', line 5 def expired? = created_at && Time.now - created_at >= duration |