Class: Rack::Cache::MetaStore::GAEStore
- Inherits:
-
Rack::Cache::MetaStore
- Object
- Rack::Cache::MetaStore
- Rack::Cache::MetaStore::GAEStore
- Defined in:
- lib/rack/cache/metastore.rb
Constant Summary
Constants inherited from Rack::Cache::MetaStore
DISK, FILE, GAE, GAECACHE, HEAP, MEM, MEMCACHE, MEMCACHED
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GAEStore
constructor
A new instance of GAEStore.
- #purge(key) ⇒ Object
- #read(key) ⇒ Object
- #write(key, entries) ⇒ Object
Methods inherited from Rack::Cache::MetaStore
#cache_key, #invalidate, #lookup, #store
Constructor Details
#initialize(options = {}) ⇒ GAEStore
Returns a new instance of GAEStore.
367 368 369 370 |
# File 'lib/rack/cache/metastore.rb', line 367 def initialize( = {}) require 'rack/cache/appengine' @cache = Rack::Cache::AppEngine::MemCache.new() end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
365 366 367 |
# File 'lib/rack/cache/metastore.rb', line 365 def cache @cache end |
Class Method Details
.resolve(uri) ⇒ Object
388 389 390 |
# File 'lib/rack/cache/metastore.rb', line 388 def self.resolve(uri) self.new(:namespace => uri.host) end |
Instance Method Details
#purge(key) ⇒ Object
382 383 384 385 386 |
# File 'lib/rack/cache/metastore.rb', line 382 def purge(key) key = hexdigest(key) cache.delete(key) nil end |
#read(key) ⇒ Object
372 373 374 375 |
# File 'lib/rack/cache/metastore.rb', line 372 def read(key) key = hexdigest(key) cache.get(key) || [] end |
#write(key, entries) ⇒ Object
377 378 379 380 |
# File 'lib/rack/cache/metastore.rb', line 377 def write(key, entries) key = hexdigest(key) cache.put(key, entries) end |