Class: Rack::Cache::MetaStore::GAEStore
Constant Summary
DISK, FILE, GAE, GAECACHE, HEAP, MEM, MEMCACHE, MEMCACHED
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#cache_key, #invalidate, #lookup, #store
Constructor Details
#initialize(options = {}) ⇒ GAEStore
411
412
413
414
|
# File 'lib/rack/cache/meta_store.rb', line 411
def initialize(options = {})
require 'rack/cache/app_engine'
@cache = Rack::Cache::AppEngine::MemCache.new(options)
end
|
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
409
410
411
|
# File 'lib/rack/cache/meta_store.rb', line 409
def cache
@cache
end
|
Class Method Details
.resolve(uri) ⇒ Object
432
433
434
|
# File 'lib/rack/cache/meta_store.rb', line 432
def self.resolve(uri)
self.new(:namespace => uri.host)
end
|
Instance Method Details
#purge(key) ⇒ Object
426
427
428
429
430
|
# File 'lib/rack/cache/meta_store.rb', line 426
def purge(key)
key = hexdigest(key)
cache.delete(key)
nil
end
|
#read(key) ⇒ Object
416
417
418
419
|
# File 'lib/rack/cache/meta_store.rb', line 416
def read(key)
key = hexdigest(key)
cache.get(key) || []
end
|
#write(key, entries) ⇒ Object
421
422
423
424
|
# File 'lib/rack/cache/meta_store.rb', line 421
def write(key, entries)
key = hexdigest(key)
cache.put(key, entries)
end
|