Module: Avm::Launcher::Instances::Base::Cache

Defined in:
lib/avm/launcher/instances/base/cache.rb

Instance Method Summary collapse

Instance Method Details

#cache_key(key, &block) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/avm/launcher/instances/base/cache.rb', line 12

def cache_key(key, &block)
  v = cache_key_get(key)
  return v if v.present? || block.nil?

  v = yield
  cache_key_write(key, v)
  v
end

#cache_path(subpath) ⇒ Object



8
9
10
# File 'lib/avm/launcher/instances/base/cache.rb', line 8

def cache_path(subpath)
  File.join(cache_root, subpath)
end