Object
Maintains a collection of MetaStore and EntityStore instances keyed by URI. A single instance of this class can be used across a single process to ensure that only a single instance of a backing store is created per unique storage URI.
# File lib/rack/cache/storage.rb, line 25 25: def clear 26: @metastores.clear 27: @entitystores.clear 28: nil 29: end
# File lib/rack/cache/storage.rb, line 32 32: def create_store(type, uri) 33: if uri.respond_to?(:scheme) || uri.respond_to?(:to_str) 34: uri = URI.parse(uri) unless uri.respond_to?(:scheme) 35: if type.const_defined?(uri.scheme.upcase) 36: klass = type.const_get(uri.scheme.upcase) 37: klass.resolve(uri) 38: else 39: fail "Unknown storage provider: #{uri.to_s}" 40: end 41: else 42: # hack in support for passing a Dalli::Client or Memcached object 43: # as the storage URI. 44: case 45: when defined?(::Dalli) && uri.kind_of?(::Dalli::Client) 46: type.const_get(:Dalli).resolve(uri) 47: when defined?(::Memcached) && uri.respond_to?(:stats) 48: type.const_get(:MemCached).resolve(uri) 49: else 50: fail "Unknown storage provider: #{uri.to_s}" 51: end 52: end 53: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.