Class: Rack::Cache::MetaStore::Moneta

Inherits:
Rack::Cache::MetaStore show all
Extended by:
Rack::Cache::MonetaResolver
Defined in:
lib/rack/cache/moneta.rb

Constant Summary

Constants inherited from Rack::Cache::MetaStore

MONETA

Instance Method Summary collapse

Methods included from Rack::Cache::MonetaResolver

resolve

Constructor Details

#initialize(cache) ⇒ Moneta

Returns a new instance of Moneta



38
39
40
# File 'lib/rack/cache/moneta.rb', line 38

def initialize(cache)
  @cache = cache
end

Instance Method Details

#purge(key) ⇒ Object



50
51
52
53
# File 'lib/rack/cache/moneta.rb', line 50

def purge(key)
  @cache.delete(key)
  nil
end

#read(key) ⇒ Object



42
43
44
# File 'lib/rack/cache/moneta.rb', line 42

def read(key)
  @cache[key] || []
end

#write(key, entries) ⇒ Object



46
47
48
# File 'lib/rack/cache/moneta.rb', line 46

def write(key, entries)
  @cache[key] = entries
end