class BioLocus::SerializeMapper
Public Class Methods
new(dbname)
click to toggle source
# File lib/bio-locus/dbmapper.rb, line 4 def initialize dbname @dbname = dbname @h = {} if File.exist?(@dbname) @h = Marshal.load(File.read(@dbname)) end end
Public Instance Methods
[](key)
click to toggle source
# File lib/bio-locus/dbmapper.rb, line 12 def [] key @h[key] end
[]=(key, value)
click to toggle source
# File lib/bio-locus/dbmapper.rb, line 16 def []= key, value @h[key] = value end
close()
click to toggle source
# File lib/bio-locus/dbmapper.rb, line 20 def close File.open(@dbname, 'w') {|f| f.write(Marshal.dump(@h)) } end