Class: Moneta::Adapters::SDBM
- Inherits:
-
SDBM
- Object
- SDBM
- Moneta::Adapters::SDBM
- Includes:
- Defaults
- Defined in:
- lib/moneta/adapters/sdbm.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #delete(key) ⇒ Object
-
#initialize(options = {}) ⇒ SDBM
constructor
A new instance of SDBM.
- #key?(key) ⇒ Boolean
- #store(key, value) ⇒ Object
Methods included from Defaults
Constructor Details
#initialize(options = {}) ⇒ SDBM
Returns a new instance of SDBM.
8 9 10 11 |
# File 'lib/moneta/adapters/sdbm.rb', line 8 def initialize( = {}) raise "No :file options specified" unless file = [:file] super(file) end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 16 17 |
# File 'lib/moneta/adapters/sdbm.rb', line 13 def [](key) if val = super(key_for(key)) deserialize(val) end end |
#delete(key) ⇒ Object
27 28 29 30 31 |
# File 'lib/moneta/adapters/sdbm.rb', line 27 def delete(key, *) if val = super(key_for(key)) deserialize(val) end end |
#key?(key) ⇒ Boolean
23 24 25 |
# File 'lib/moneta/adapters/sdbm.rb', line 23 def key?(key, *) super(key_for(key)) end |
#store(key, value) ⇒ Object
19 20 21 |
# File 'lib/moneta/adapters/sdbm.rb', line 19 def store(key, value, *) super(key_for(key), serialize(value)) end |