class Rack::Cache::EntityStore::MemCacheBase
Base class for memcached entity stores.
Attributes
cache[R]
The underlying Memcached instance used to communicate with the memcached daemon.
Public Class Methods
resolve(uri)
click to toggle source
# File lib/rack/cache/entity_store.rb 184 def self.resolve(uri) 185 if uri.respond_to?(:scheme) 186 server = "#{uri.host}:#{uri.port || '11211'}" 187 options = parse_query(uri.query) 188 options.keys.each do |key| 189 value = 190 case value = options.delete(key) 191 when 'true' ; true 192 when 'false' ; false 193 else value.to_sym 194 end 195 options[key.to_sym] = value 196 end 197 options[:namespace] = uri.path.sub(/^\//, '') 198 new server, options 199 else 200 # if the object provided is not a URI, pass it straight through 201 # to the underlying implementation. 202 new uri 203 end 204 end
Public Instance Methods
open(key)
click to toggle source
# File lib/rack/cache/entity_store.rb 179 def open(key) 180 data = read(key) 181 data && [data] 182 end