class Rack::Cache::MetaStore::Dalli

Public Class Methods

new(server="localhost:11211", options={}) click to toggle source
    # File lib/rack/cache/meta_store.rb
323 def initialize(server="localhost:11211", options={})
324   @cache =
325     if server.respond_to?(:stats)
326       server
327     else
328       require 'dalli'
329       ::Dalli::Client.new(server, options)
330     end
331 end

Public Instance Methods

purge(key) click to toggle source
    # File lib/rack/cache/meta_store.rb
343 def purge(key)
344   cache.delete(hexdigest(key))
345   nil
346 end
read(key) click to toggle source
    # File lib/rack/cache/meta_store.rb
333 def read(key)
334   key = hexdigest(key)
335   cache.get(key) || []
336 end
write(key, entries) click to toggle source
    # File lib/rack/cache/meta_store.rb
338 def write(key, entries)
339   key = hexdigest(key)
340   cache.set(key, entries)
341 end