Class Rack::Cache::MetaStore::Dalli

  1. lib/rack/cache/metastore.rb

Methods

public class

  1. new

public instance

  1. purge
  2. read
  3. write

Public class methods

new (server="localhost:11211", options={})
[show source]
     # File lib/rack/cache/metastore.rb, line 305
305:       def initialize(server="localhost:11211", options={})
306:         @cache =
307:           if server.respond_to?(:stats)
308:             server
309:           else
310:             require 'dalli'
311:             ::Dalli::Client.new(server, options)
312:           end
313:       end

Public instance methods

purge (key)
[show source]
     # File lib/rack/cache/metastore.rb, line 325
325:       def purge(key)
326:         cache.delete(hexdigest(key))
327:         nil
328:       end
read (key)
[show source]
     # File lib/rack/cache/metastore.rb, line 315
315:       def read(key)
316:         key = hexdigest(key)
317:         cache.get(key) || []
318:       end
write (key, entries)
[show source]
     # File lib/rack/cache/metastore.rb, line 320
320:       def write(key, entries)
321:         key = hexdigest(key)
322:         cache.set(key, entries)
323:       end