generate_line(row, options = Hash.new) public

This method is a shortcut for converting a single row (Array) into a CSV String.

The options parameter can be anthing CSV::new() understands. This method understands an additional :encoding parameter to set the base Encoding for the output. This method will try to guess your Encoding from the first non-nil field in row, if possible, but you may need to use this parameter as a backup plan.

The :row_sep option defaults to $INPUT_RECORD_SEPARATOR ($/) when calling this method.

Show source
Register or log in to add new notes.