Class: Moneta::Adapters::GDBM
- Defined in:
- lib/moneta/adapters/gdbm.rb
Overview
GDBM backend
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ GDBM
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 = {}) ⇒ GDBM
Constructor
12 13 14 15 |
# File 'lib/moneta/adapters/gdbm.rb', line 12 def initialize( = {}) raise ArgumentError, 'Option :file is required' unless [:file] @hash = ::GDBM.new([:file]) end |
Instance Method Details
#close ⇒ Object
17 18 19 20 |
# File 'lib/moneta/adapters/gdbm.rb', line 17 def close @hash.close nil end |