Class: RedshiftConnector::Reader::TSV
- Defined in:
- lib/redshift_connector/reader/tsv.rb
Overview
Parses TSV (Tab Separated Format) files.
Constant Summary
Constants inherited from Abstract
Class Method Summary collapse
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(f) ⇒ TSV
constructor
A new instance of TSV.
Methods inherited from Abstract
declare_reader, get_reader_class
Constructor Details
#initialize(f) ⇒ TSV
Returns a new instance of TSV.
14 15 16 |
# File 'lib/redshift_connector/reader/tsv.rb', line 14 def initialize(f) @f = f end |
Class Method Details
.data_object?(key) ⇒ Boolean
10 11 12 |
# File 'lib/redshift_connector/reader/tsv.rb', line 10 def self.data_object?(key) /\.tsv(?:\.|\z)/ =~ File.basename(key) end |
Instance Method Details
#each(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/redshift_connector/reader/tsv.rb', line 18 def each(&block) @f.each_line do |line| yield line.chomp.split("\t", -1) end end |