Class: Moneta::Adapters::GDBM
- Defined in:
- lib/moneta/adapters/gdbm.rb
Overview
GDBM backend
Instance Method Summary collapse
-
#close ⇒ Object
Explicitly close the store.
-
#initialize(options = {}) ⇒ GDBM
constructor
A new instance of GDBM.
Methods included from IncrementSupport
Methods included from HashAdapter
#clear, #delete, #key?, #load, #store
Methods included from Defaults
#[], #[]=, #decrement, #fetch, #increment, #key?
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}) ⇒ GDBM
Returns a new instance of GDBM.
10 11 12 13 |
# File 'lib/moneta/adapters/gdbm.rb', line 10 def initialize( = {}) raise ArgumentError, 'Option :file is required' unless [:file] @hash = ::GDBM.new([:file]) end |
Instance Method Details
#close ⇒ Object
Explicitly close the store
16 17 18 19 |
# File 'lib/moneta/adapters/gdbm.rb', line 16 def close @hash.close nil end |