method

<<

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: CSV::Writer
<<(row) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/csv/writer.rb, line 24
    def <<(row)
      case row
      when Row
        row = row.fields
      when Hash
        row = @headers.collect {|header| row[header]}
      end

      @headers ||= row if @use_headers
      @lineno += 1

      row = @fields_converter.convert(row, nil, lineno) if @fields_converter

      converted_row = row.collect do |field|
        quote(field)
      end
      line = converted_row.join(@column_separator) + @row_separator
      if @output_encoding
        line = line.encode(@output_encoding)
      end
      @output << line

      self
    end
Register or log in to add new notes.