# File lib/rack/cache/entitystore.rb, line 295 def initialize(options = {}) require 'rack/cache/appengine' @cache = Rack::Cache::AppEngine::MemCache.new(options) end
# File lib/rack/cache/entitystore.rb, line 328 def self.resolve(uri) self.new(:namespace => uri.host) end
# File lib/rack/cache/entitystore.rb, line 300 def exist?(key) cache.contains?(key) end
# File lib/rack/cache/entitystore.rb, line 308 def open(key) if data = read(key) [data] else nil end end
# File lib/rack/cache/entitystore.rb, line 323 def purge(key) cache.delete(key) nil end
# File lib/rack/cache/entitystore.rb, line 304 def read(key) cache.get(key) end
# File lib/rack/cache/entitystore.rb, line 316 def write(body) buf = StringIO.new key, size = slurp(body){|part| buf.write(part) } cache.put(key, buf.string) [key, size] end