Rack::Cache::EntityStore::GAEStore

Attributes

cache[R]

Public Class Methods

new(options = {}) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 297
297:       def initialize(options = {})
298:         require 'rack/cache/appengine'
299:         @cache = Rack::Cache::AppEngine::MemCache.new(options)
300:       end
resolve(uri) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 330
330:       def self.resolve(uri)
331:         self.new(:namespace => uri.host)
332:       end

Public Instance Methods

exist?(key) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 302
302:       def exist?(key)
303:         cache.contains?(key)
304:       end
open(key) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 310
310:       def open(key)
311:         if data = read(key)
312:           [data]
313:         else
314:           nil
315:         end
316:       end
purge(key) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 325
325:       def purge(key)
326:         cache.delete(key)
327:         nil
328:       end
read(key) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 306
306:       def read(key)
307:         cache.get(key)
308:       end
write(body, ttl=nil) click to toggle source
     # File lib/rack/cache/entitystore.rb, line 318
318:       def write(body, ttl=nil)
319:         buf = StringIO.new
320:         key, size = slurp(body){|part| buf.write(part) }
321:         cache.put(key, buf.string, ttl)
322:         [key, size]
323:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.