module BioTable::Indexer
Public Class Methods
create_index(table, columns)
click to toggle source
Create an index (Hash) of column field contents, pointing to a TableRow
# File lib/bio-table/indexer.rb, line 7 def self.create_index table, columns idx = {} table.each do | row | idx[make_key(row,columns)] = row end idx end
make_key(row, columns)
click to toggle source
# File lib/bio-table/indexer.rb, line 15 def self.make_key row, columns columns.map { |i| row.all_fields[i] } end