Method: Bio::FlatFileIndex::DataBank#initialize

Defined in:
lib/bio/io/flatfile/index.rb

#initialize(name, idx_type = nil, hash = {}) ⇒ DataBank

Returns a new instance of DataBank.



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
# File 'lib/bio/io/flatfile/index.rb', line 1148

def initialize(name, idx_type = nil, hash = {})
  @dbname = name.dup
  @dbname.freeze
  @bdb = nil

  @always_check = true
  self.index_type = (hash['index'] or idx_type)

  if @bdb then
    @config = BDBwrapper.new(@dbname, 'config')
    @bdb_fileids = BDBwrapper.new(@dbname, 'fileids')
    @nsclass_pri = BDB_1::PrimaryNameSpace
    @nsclass_sec = BDB_1::SecondaryNameSpace
  else
    @config = hash
    @nsclass_pri = Flat_1::PrimaryNameSpace
    @nsclass_sec = Flat_1::SecondaryNameSpace
  end
  true
end