Class: Memery::ClassMethods::MemoizationModule::Cache
- Inherits:
-
Struct
- Object
- Struct
- Memery::ClassMethods::MemoizationModule::Cache
- Defined in:
- lib/memery.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result
66 67 68 |
# File 'lib/memery.rb', line 66 def result @result end |
#time ⇒ Object
Returns the value of attribute time
66 67 68 |
# File 'lib/memery.rb', line 66 def time @time end |
Instance Method Details
#fresh?(ttl) ⇒ Boolean
67 68 69 70 |
# File 'lib/memery.rb', line 67 def fresh?(ttl) return true if ttl.nil? Memery.monotonic_clock <= time + ttl end |