Class: BioTable::EvalFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-table/formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(evaluate) ⇒ EvalFormatter

Returns a new instance of EvalFormatter.



54
55
56
# File 'lib/bio-table/formatter.rb', line 54

def initialize evaluate
  @evaluate = evaluate
end

Instance Method Details

#write(list) ⇒ Object



57
58
59
60
61
# File 'lib/bio-table/formatter.rb', line 57

def write list
  field = list.dup.map { |e| (e==nil ? "" : e) }
  print eval(@evaluate)
  print "\n"
end