class Rack::Cache::Storage
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.
Public Class Methods
Source
# File lib/rack/cache/storage.rb, line 60 def self.instance @@singleton_instance end
Source
# File lib/rack/cache/storage.rb, line 12 def initialize @metastores = {} @entitystores = {} end
Public Instance Methods
Source
# File lib/rack/cache/storage.rb, line 25 def clear @metastores.clear @entitystores.clear nil end
Source
# File lib/rack/cache/storage.rb, line 21 def resolve_entitystore_uri(uri, options = {}) @entitystores[uri.to_s] ||= create_store(EntityStore, uri, options) end
Source
# File lib/rack/cache/storage.rb, line 17 def resolve_metastore_uri(uri, options = {}) @metastores[uri.to_s] ||= create_store(MetaStore, uri, options) end