Class: Moneta::Adapters::SDBM
- Defined in:
- lib/moneta/adapters/sdbm.rb
Overview
SDBM backend
Instance Attribute Summary
Attributes included from HashAdapter
Instance Method Summary collapse
-
#close ⇒ Object
Explicitly close the store.
-
#initialize(options = {}) ⇒ SDBM
constructor
A new instance of SDBM.
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 = {}) ⇒ SDBM
Returns a new instance of SDBM.
11 12 13 14 15 16 17 |
# File 'lib/moneta/adapters/sdbm.rb', line 11 def initialize( = {}) @backend = [:backend] || begin raise ArgumentError, 'Option :file is required' unless [:file] ::SDBM.new([:file]) end end |
Instance Method Details
#close ⇒ Object
Explicitly close the store
20 21 22 23 |
# File 'lib/moneta/adapters/sdbm.rb', line 20 def close @backend.close nil end |