Cache store lookup name
# File lib/merb-cache/cache.rb, line 42 42: def self.[](*names) 43: if names.size == 1 44: Thread.current[:'merb-cache'] ||= {} 45: (Thread.current[:'merb-cache'][names.first] ||= stores[names.first].clone) 46: else 47: AdhocStore[*names] 48: end 49: rescue TypeError 50: raise(StoreNotFound, "Could not find the :#{names.first} store") 51: end
Clones the cache stores for the current thread
# File lib/merb-cache/cache.rb, line 54 54: def self.clone_stores 55: @stores.inject({}) {|h, (k, s)| h[k] = s.clone; h} 56: end
Default store name is :default.
# File lib/merb-cache/cache.rb, line 79 79: def self.default_store_name 80: :default 81: end
Checks to see if a given store exists already.
# File lib/merb-cache/cache.rb, line 72 72: def self.exists?(name) 73: return true if self[name] 74: rescue StoreNotFound 75: return false 76: end
Registers the cache store name with a type & options name
# File lib/merb-cache/cache.rb, line 62 62: def self.register(name, klass = nil, opts = {}) 63: klass, opts = nil, klass if klass.is_a? Hash 64: name, klass = default_store_name, name if klass.nil? 65: 66: raise StoreExists, "#{name} store already setup" if @stores.has_key?(name) 67: 68: @stores[name] = (AdhocStore === klass) ? klass : klass.new(opts) 69: end
# File lib/merb-cache/cache.rb, line 9 9: def self.setup(&blk) 10: if Merb::BootLoader.finished?(Merb::BootLoader::BeforeAppLoads) 11: instance_eval(&blk) unless blk.nil? 12: else 13: Merb::BootLoader.before_app_loads do 14: instance_eval(&blk) unless blk.nil? 15: end 16: end 17: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.