class BioTable::TextualFilter
FIXME: we should have a faster version too
Public Class Methods
new(header)
click to toggle source
# File lib/bio-table/filter.rb, line 122 def initialize header @header = header.map { |name| name.downcase } end
Public Instance Methods
method_missing(m, *args, &block)
click to toggle source
# File lib/bio-table/filter.rb, line 137 def method_missing m, *args, &block if @header i = @header.index(m.to_s) if i != nil # p @header,i return @fields[i] end raise "Unknown field (can not find column name '#{m}') in list '#{@header}'" end raise "Unknown method '#{m}'" end
textual(code, tablefields)
click to toggle source
# File lib/bio-table/filter.rb, line 126 def textual code, tablefields field = tablefields.dup fields = field # alias @fields = fields begin eval(code) rescue Exception $stderr.print "Failed to evaluate ",fields," with ",code,"\n" raise end end