Class: Kor::Input::Csv
- Inherits:
-
Base
- Object
- Base
- Kor::Input::Csv
show all
- Defined in:
- lib/kor/input/csv.rb
Direct Known Subclasses
Tsv
Constant Summary
collapse
- DELIM =
","
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #io, #parse
Instance Method Details
#gets ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/kor/input/csv.rb', line 16
def gets
if line = io.gets
::CSV.new(line.strip, col_sep: self.class::DELIM).gets
else
nil
end
end
|
#head ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/kor/input/csv.rb', line 8
def head
if line = io.gets
::CSV.new(line.strip, col_sep: self.class::DELIM).gets
else
raise ReadError, "cannot get csv header"
end
end
|