Module: BioTable::LineParser
- Defined in:
- lib/bio-table/parser.rb
Class Method Summary collapse
-
.parse(line, in_format) ⇒ Object
Converts a string into an array of string fields.
Class Method Details
.parse(line, in_format) ⇒ Object
Converts a string into an array of string fields
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bio-table/parser.rb', line 8 def LineParser::parse(line, in_format) if in_format == :csv CSV.parse(line)[0] else line.strip.split("\t").map { |field| fld = field.strip fld = nil if fld == "NA" fld } end end |