Class: Textus::Lanes::Artifact::Lifecycle

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/lanes/artifact/lifecycle.rb

Instance Method Summary collapse

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