Class: Rack::Cache::EntityStore::MemCacheBase
- Inherits:
-
Rack::Cache::EntityStore
- Object
- Rack::Cache::EntityStore
- Rack::Cache::EntityStore::MemCacheBase
- Extended by:
- Utils
- Defined in:
- lib/rack/cache/entity_store.rb
Overview
Base class for memcached entity stores.
Constant Summary
Constants inherited from Rack::Cache::EntityStore
DISK, FILE, GAE, GAECACHE, HEAP, MEM, MEMCACHE, MEMCACHED, NOOP
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
The underlying Memcached instance used to communicate with the memcached daemon.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cache ⇒ Object (readonly)
The underlying Memcached instance used to communicate with the memcached daemon.
175 176 177 |
# File 'lib/rack/cache/entity_store.rb', line 175 def cache @cache end |
Class Method Details
.resolve(uri) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/rack/cache/entity_store.rb', line 184 def self.resolve(uri) if uri.respond_to?(:scheme) server = "#{uri.host}:#{uri.port || '11211'}" = parse_query(uri.query) .keys.each do |key| value = case value = .delete(key) when 'true' ; true when 'false' ; false else value.to_sym end [key.to_sym] = value end [:namespace] = uri.path.sub(/^\//, '') new server, else # if the object provided is not a URI, pass it straight through # to the underlying implementation. new uri end end |
Instance Method Details
#open(key) ⇒ Object
179 180 181 182 |
# File 'lib/rack/cache/entity_store.rb', line 179 def open(key) data = read(key) data && [data] end |