class Rack::Cache::EntityStore::GAEStore
Attributes
Public Class Methods
Source
# File lib/rack/cache/entity_store.rb, line 291 def initialize(options = {}) require 'rack/cache/app_engine' @cache = Rack::Cache::AppEngine::MemCache.new(options) end
Source
# File lib/rack/cache/entity_store.rb, line 324 def self.resolve(uri) self.new(:namespace => uri.host) end
Public Instance Methods
Source
# File lib/rack/cache/entity_store.rb, line 296 def exist?(key) cache.contains?(key) end
Source
# File lib/rack/cache/entity_store.rb, line 304 def open(key) if data = read(key) [data] else nil end end
Source
# File lib/rack/cache/entity_store.rb, line 319 def purge(key) cache.delete(key) nil end
Source
# File lib/rack/cache/entity_store.rb, line 312 def write(body, ttl=nil) buf = StringIO.new key, size = slurp(body){|part| buf.write(part) } cache.put(key, buf.string, ttl) [key, size] end