class BioLocus::MonetaMapper

Public Class Methods

new(storage, dbname) click to toggle source
# File lib/bio-locus/dbmapper.rb, line 26
def initialize storage, dbname
  begin
    require 'moneta'
  rescue LoadError
    $stderr.print "Error: Missing moneta. Install with command 'gem install moneta'\n"
    exit 1
  end
  @store = Moneta.new(storage, file: dbname)
end

Public Instance Methods

[](key) click to toggle source
# File lib/bio-locus/dbmapper.rb, line 36
def [] key
  @store[key]
end
[]=(key, value) click to toggle source
# File lib/bio-locus/dbmapper.rb, line 40
def []= key, value
  @store[key] = value
end
close() click to toggle source
# File lib/bio-locus/dbmapper.rb, line 44
def close
  @store.close
end