Class: MdbmDistSupport::Meta

Inherits:
Object
  • Object
show all
Includes:
CustomLogger
Defined in:
lib/mdbm_dist_support/meta.rb

Overview

Meta mdbm manager

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#metaObject

Returns the value of attribute meta.



7
8
9
# File 'lib/mdbm_dist_support/meta.rb', line 7

def meta
  @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