Rack::Cache::MetaStore::MemCached

Attributes

cache[R]

The Memcached instance used to communicated with the memcached daemon.

Public Class Methods

new(server="localhost:11211", options={}) click to toggle source
     # File lib/rack/cache/metastore.rb, line 343
343:       def initialize(server="localhost:11211", options={})
344:         options[:prefix_key] ||= options.delete(:namespace) if options.key?(:namespace)
345:         @cache =
346:           if server.respond_to?(:stats)
347:             server
348:           else
349:             require 'memcached'
350:             Memcached.new(server, options)
351:           end
352:       end

Public Instance Methods

purge(key) click to toggle source
     # File lib/rack/cache/metastore.rb, line 366
366:       def purge(key)
367:         key = hexdigest(key)
368:         cache.delete(key)
369:         nil
370:       rescue Memcached::NotFound
371:         nil
372:       end
read(key) click to toggle source
     # File lib/rack/cache/metastore.rb, line 354
354:       def read(key)
355:         key = hexdigest(key)
356:         cache.get(key)
357:       rescue Memcached::NotFound
358:         []
359:       end
write(key, entries) click to toggle source
     # File lib/rack/cache/metastore.rb, line 361
361:       def write(key, entries)
362:         key = hexdigest(key)
363:         cache.set(key, entries)
364:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.