class Memcache::Pool
Attributes
fallback[R]
Public Class Methods
new()
click to toggle source
# File lib/memcache.rb, line 446 def initialize @cache_by_scope = {} @cache_by_scope[:default] = Memcache.new(:server => Memcache::LocalServer) @fallback = :default end
Public Instance Methods
[](scope)
click to toggle source
# File lib/memcache.rb, line 460 def [](scope) @cache_by_scope[scope.to_sym] || @cache_by_scope[fallback] end
[]=(scope, cache)
click to toggle source
# File lib/memcache.rb, line 464 def []=(scope, cache) @cache_by_scope[scope.to_sym] = cache end
fallback=(scope)
click to toggle source
# File lib/memcache.rb, line 456 def fallback=(scope) @fallback = scope.to_sym end
include?(scope)
click to toggle source
# File lib/memcache.rb, line 452 def include?(scope) @cache_by_scope.include?(scope.to_sym) end
reset()
click to toggle source
# File lib/memcache.rb, line 468 def reset @cache_by_scope.values.each {|c| c.reset} end