Class: Tb::HeaderTSVReader

Inherits:
HeaderReader show all
Defined in:
lib/tb/tsv.rb

Instance Attribute Summary

Attributes inherited from HeaderReader

#enable_warning, #header_array_hook, #row_array_hook

Instance Method Summary collapse

Methods inherited from HeaderReader

#get_hash, #get_named_header, #header_and_each, #header_known?

Methods included from EnumerableWithEach

#each

Methods included from Enumerable

#cat, #extsort_by, #natjoin2, #natjoin2_outer, #newfield, #to_fileenumerator, #with_cumulative_header, #with_header, #write_to_csv, #write_to_json, #write_to_ltsv, #write_to_pnm, #write_to_tsv, #write_with

Constructor Details

#initialize(io) ⇒ HeaderTSVReader

Returns a new instance of HeaderTSVReader.



45
46
47
48
49
50
51
52
53
54
# File 'lib/tb/tsv.rb', line 45

def initialize(io)
  super lambda {
    line = io.gets
    if line
      Tb.tsv_fields_split(line)
    else
      nil
    end
  }
end