Class: Moneta::Adapters::DBM
- Defined in:
- lib/moneta/adapters/dbm.rb
Overview
DBM backend (Berkeley DB)
Instance Attribute Summary
Attributes included from HashAdapter
Instance Method Summary collapse
-
#close ⇒ Object
Explicitly close the store.
-
#initialize(options = {}) ⇒ DBM
constructor
A new instance of DBM.
Methods included from CreateSupport
Methods included from IncrementSupport
Methods included from HashAdapter
#clear, #delete, #key?, #load, #store
Methods included from Defaults
#[], #[]=, #create, #decrement, #features, #fetch, included, #increment, #key?, #supports?
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}) ⇒ DBM
Returns a new instance of DBM.
11 12 13 14 15 16 17 |
# File 'lib/moneta/adapters/dbm.rb', line 11 def initialize( = {}) @backend = [:backend] || begin raise ArgumentError, 'Option :file is required' unless [:file] ::DBM.new([:file]) end end |
Instance Method Details
#close ⇒ Object
Explicitly close the store
20 21 22 23 |
# File 'lib/moneta/adapters/dbm.rb', line 20 def close @backend.close nil end |