Class CSV::Writer
In: lib/csv.rb
Parent: Object

CSV formatted string/stream writer.

EXAMPLE

  Write rows to 'csvout' file.

  outfile = File.open('csvout', 'wb')
  CSV::Writer.generate(outfile) do |csv|
    csv << ['c1', nil, '', '"', "\r\n", 'c2']
    ...
  end

  outfile.close

Methods

<<   add_row   close   create   generate   new  

Public Class methods

str_or_writable must handle ’<<(string)’.

Given block is called with the writer instance. str_or_writable must handle ’<<(string)’.

Public Instance methods

dump CSV stream to the device. argument must be an Array of String.

add_row(row)

Alias for #<<

[Validate]

ruby-doc.org is a community service provided by James Britt and Rising Tide Software, a Phoenix, Arizona, Ruby application development company.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.