Class: Moneta::Adapters::LocalMemCache
- Includes:
- Mixins::HashAdapter
- Defined in:
- lib/moneta/adapters/localmemcache.rb
Overview
LocalMemCache backend
Instance Method Summary collapse
- #delete(key, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ LocalMemCache
constructor
Constructor.
Methods included from Mixins::HashAdapter
Methods inherited from Base
#[], #[]=, #close, #decrement, #fetch, #increment, #key?
Methods included from Mixins::WithOptions
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}) ⇒ LocalMemCache
Constructor
14 15 16 17 |
# File 'lib/moneta/adapters/localmemcache.rb', line 14 def initialize( = {}) raise ArgumentError, 'Option :file is required' unless [:file] @hash = ::LocalMemCache.new(:filename => [:file]) end |
Instance Method Details
#delete(key, options = {}) ⇒ Object
19 20 21 22 23 |
# File 'lib/moneta/adapters/localmemcache.rb', line 19 def delete(key, = {}) value = load(key, ) @hash.delete(key) value end |