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