Class: Moneta::Adapters::DBM
- Defined in:
- lib/moneta/adapters/dbm.rb
Overview
DBM backend (Berkeley DB)
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ DBM
constructor
Constructor.
Methods included from Mixins::HashAdapter
#clear, #delete, #key?, #load, #store
Methods included from Mixins::IncrementSupport
Methods inherited from Base
#[], #[]=, #decrement, #fetch, #increment, #key?
Methods included from Mixins::WithOptions
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}) ⇒ DBM
Constructor
12 13 14 15 |
# File 'lib/moneta/adapters/dbm.rb', line 12 def initialize( = {}) raise ArgumentError, 'Option :file is required' unless [:file] @hash = ::DBM.new([:file]) end |
Instance Method Details
#close ⇒ Object
17 18 19 20 |
# File 'lib/moneta/adapters/dbm.rb', line 17 def close @hash.close nil end |