Class: Textus::Lanes::Artifact::Lifecycle
- Inherits:
-
Object
- Object
- Textus::Lanes::Artifact::Lifecycle
- Defined in:
- lib/textus/lanes/artifact/lifecycle.rb
Instance Method Summary collapse
-
#initialize(cache) ⇒ Lifecycle
constructor
A new instance of Lifecycle.
- #on_expire(key) ⇒ Object
- #on_stale(key) ⇒ Object
- #retention(key) ⇒ Object
Constructor Details
#initialize(cache) ⇒ Lifecycle
Returns a new instance of Lifecycle.
5 6 7 |
# File 'lib/textus/lanes/artifact/lifecycle.rb', line 5 def initialize(cache) @cache = cache end |
Instance Method Details
#on_expire(key) ⇒ Object
13 14 15 |
# File 'lib/textus/lanes/artifact/lifecycle.rb', line 13 def on_expire(key) @cache.expire(key) end |
#on_stale(key) ⇒ Object
9 10 11 |
# File 'lib/textus/lanes/artifact/lifecycle.rb', line 9 def on_stale(key) @cache.expire(key) end |
#retention(key) ⇒ Object
17 18 19 |
# File 'lib/textus/lanes/artifact/lifecycle.rb', line 17 def retention(key) @cache.ttl(key) end |