Class: CSV::IOBuf

Inherits:
StreamBuf show all
Defined in:
lib/csv.rb

Overview

Buffered IO.

EXAMPLE

File 'bigdata' could be a giga-byte size one!

buf = CSV::IOBuf.new(File.open('bigdata', 'rb')) CSV::Reader.new(buf).each do |row| p row break if row.data == 'admin' end

Instance Method Summary collapse

Methods inherited from StreamBuf

#[], #drop, #is_eos?

Constructor Details

#initialize(s) ⇒ IOBuf

Returns a new instance of IOBuf.



973
974
975
976
# File 'lib/csv.rb', line 973

def initialize(s)
  @s = s
  super()
end

Instance Method Details

#closeObject



978
979
980
# File 'lib/csv.rb', line 978

def close
  terminate
end