Class: CSV::IOReader
Instance Method Summary collapse
-
#close_on_terminate ⇒ Object
Tell this reader to close the IO when terminated (Triggered by invoking CSV::IOReader#close).
-
#initialize(io, fs = ',',, rs = nil) ⇒ IOReader
constructor
A new instance of IOReader.
Methods inherited from Reader
#close, create, #each, parse, #shift
Constructor Details
#initialize(io, fs = ',',, rs = nil) ⇒ IOReader
Returns a new instance of IOReader.
616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/csv.rb', line 616 def initialize(io, fs = ',', rs = nil) @io = io @fs = fs @rs = rs @dev = CSV::IOBuf.new(@io) @idx = 0 if @dev[0] == 0xef and @dev[1] == 0xbb and @dev[2] == 0xbf @idx += 3 end @close_on_terminate = false end |
Instance Method Details
#close_on_terminate ⇒ Object
Tell this reader to close the IO when terminated (Triggered by invoking CSV::IOReader#close).
630 631 632 |
# File 'lib/csv.rb', line 630 def close_on_terminate @close_on_terminate = true end |