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.



40
41
42
# File 'lib/rack/cache/moneta.rb', line 40

def initialize(cache)
  @cache = cache
end

Instance Method Details

#purge(key) ⇒ Object



52
53
54
55
# File 'lib/rack/cache/moneta.rb', line 52

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

#read(key) ⇒ Object



44
45
46
# File 'lib/rack/cache/moneta.rb', line 44

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

#write(key, entries) ⇒ Object



48
49
50
# File 'lib/rack/cache/moneta.rb', line 48

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