Class: MdbmDistSupport::Meta
- Inherits:
-
Object
- Object
- MdbmDistSupport::Meta
- Includes:
- CustomLogger
- Defined in:
- lib/mdbm_dist_support/meta.rb
Overview
Meta mdbm manager
Instance Attribute Summary collapse
-
#meta ⇒ Object
Returns the value of attribute meta.
Instance Method Summary collapse
- #fetch(key) ⇒ Object
-
#initialize(path) ⇒ Meta
constructor
A new instance of Meta.
- #store(key, val) ⇒ Object
Constructor Details
#initialize(path) ⇒ Meta
Returns a new instance of Meta.
11 12 13 |
# File 'lib/mdbm_dist_support/meta.rb', line 11 def initialize(path) @meta = Mdbm.new(path, Mdbm::MDBM_O_RDWR | Mdbm::MDBM_O_CREAT, 0644, 0, 0) end |
Instance Attribute Details
#meta ⇒ Object
Returns the value of attribute meta.
7 8 9 |
# File 'lib/mdbm_dist_support/meta.rb', line 7 def @meta end |
Instance Method Details
#fetch(key) ⇒ Object
15 16 17 |
# File 'lib/mdbm_dist_support/meta.rb', line 15 def fetch(key) @meta.fetch(key) end |
#store(key, val) ⇒ Object
19 20 21 |
# File 'lib/mdbm_dist_support/meta.rb', line 19 def store(key, val) @meta.store(key.to_s, val.to_s, Mdbm::MDBM_REPLACE) end |