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)
[show source]
# File lib/rack/cache/entitystore.rb, line 184 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[k.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)
[show source]
# File lib/rack/cache/entitystore.rb, line 179 179: def open(key) 180: data = read(key) 181: data && [data] 182: end