Class: Rack::Cache::MetaStore::Redis
- Inherits:
-
RedisBase
- Object
- Rack::Cache::MetaStore
- RedisBase
- Rack::Cache::MetaStore::Redis
- Defined in:
- lib/rack/cache/redis_metastore.rb
Constant Summary
Constants inherited from Rack::Cache::MetaStore
Instance Attribute Summary
Attributes inherited from RedisBase
Instance Method Summary collapse
-
#initialize(server, options = {}) ⇒ Redis
constructor
A new instance of Redis.
- #purge(key) ⇒ Object
- #read(key) ⇒ Object
- #write(key, entries) ⇒ Object
Methods inherited from RedisBase
Constructor Details
Instance Method Details
#purge(key) ⇒ Object
33 34 35 36 |
# File 'lib/rack/cache/redis_metastore.rb', line 33 def purge(key) cache.del(hexdigest(key)) nil end |
#read(key) ⇒ Object
23 24 25 26 |
# File 'lib/rack/cache/redis_metastore.rb', line 23 def read(key) key = hexdigest(key) cache.get(key) || [] end |
#write(key, entries) ⇒ Object
28 29 30 31 |
# File 'lib/rack/cache/redis_metastore.rb', line 28 def write(key, entries) key = hexdigest(key) cache.set(key, entries) end |