Class: ArCache::Store
- Inherits:
-
Object
- Object
- ArCache::Store
- Defined in:
- lib/ar_cache/store.rb
Class Method Summary collapse
- .read(name) ⇒ Object
- .read_multi(names) ⇒ Object
- .write(name, value) ⇒ Object
- .write_multi(hash) ⇒ Object
Class Method Details
.read(name) ⇒ Object
19 20 21 |
# File 'lib/ar_cache/store.rb', line 19 def read(name) load(ArCache::Configuration.cache_store.read(name, @options)) end |
.read_multi(names) ⇒ Object
23 24 25 26 27 |
# File 'lib/ar_cache/store.rb', line 23 def read_multi(names) entries = ArCache::Configuration.cache_store.read_multi(*names, @options) entries.each { |k, v| entries[k] = load(v) } entries end |
.write(name, value) ⇒ Object
10 11 12 |
# File 'lib/ar_cache/store.rb', line 10 def write(name, value) ArCache::Configuration.cache_store.write(name, dump(value), @options) end |
.write_multi(hash) ⇒ Object
14 15 16 17 |
# File 'lib/ar_cache/store.rb', line 14 def write_multi(hash) hash.each { |k, v| hash[k] = dump(v) } ArCache::Configuration.cache_store.write_multi(hash, @options) end |