U:RDoc::AnyMethod[iI"new:ETI"
CSV::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [
I"RThis constructor will wrap either a String or IO object passed in +data+ for ;TI"Rreading and/or writing. In addition to the CSV instance methods, several IO ;TI"Qmethods are delegated. (See CSV::open() for a complete list.) If you pass ;TI"Na String for +data+, you can later retrieve it (after writing to it, for ;TI" example) with CSV.string().;To:RDoc::Markup::BlankLine o;
; [I"INote that a wrapped String will be positioned at the beginning (for ;TI"Nreading). If you want it at the end (for writing), use CSV::generate(). ;TI"NIf you want any other positioning, pass a preset StringIO object instead.;T@o;
; [I"OYou may set any reading and/or writing preferences in the +options+ Hash. ;TI"Available options are:;T@o:RDoc::Markup::List:
@type: NOTE:@items[o:RDoc::Markup::ListItem:@label[I":col_sep;T; [o;
; [I"+The String placed between each field. ;TI")This String will be transcoded into ;TI"(the data's Encoding before parsing.;To;;[I":row_sep;T; [o;
; ["I",The String appended to the end of each ;TI"*row. This can be set to the special ;TI",:auto setting, which requests ;TI"*that CSV automatically discover this ;TI"*from the data. Auto-discovery reads ;TI",ahead in the data looking for the next ;TI"("\r\n", "\n", or ;TI")"\r" sequence. A sequence ;TI"+will be selected even if it occurs in ;TI"'a quoted field, assuming that you ;TI"&would have the same line endings ;TI"+there. If none of those sequences is ;TI"%found, +data+ is ARGF, ;TI")STDIN, STDOUT, or ;TI",STDERR, or the stream is only ;TI"'available for output, the default ;TI"&$INPUT_RECORD_SEPARATOR ;TI"(($/) is used. Obviously, ;TI")discovery takes a little time. Set ;TI"+manually if speed is important. Also ;TI"+note that IO objects should be opened ;TI"'in binary mode on Windows if this ;TI"!feature will be used as the ;TI"'line-ending translation can cause ;TI"*problems with resetting the document ;TI")position to where it was before the ;TI"%read ahead. This String will be ;TI")transcoded into the data's Encoding ;TI"before parsing.;To;;[I" :quote_char;T; [o;
; [I")The character used to quote fields. ;TI"'This has to be a single character ;TI"!String. This is useful for ;TI"&application that incorrectly use ;TI"'' as the quote character ;TI"(instead of the correct ". ;TI"'CSV will always consider a double ;TI")sequence of this character to be an ;TI"(escaped quote. This String will be ;TI")transcoded into the data's Encoding ;TI"before parsing.;To;;[I"&:field_size_limit;T; [o;
; [I"*This is a maximum size CSV will read ;TI")ahead looking for the closing quote ;TI"*for a field. (In truth, it reads to ;TI"'the first line ending beyond this ;TI"(size.) If a quote cannot be found ;TI"'within the limit CSV will raise a ;TI"*MalformedCSVError, assuming the data ;TI"+is faulty. You can use this limit to ;TI"&prevent what are effectively DoS ;TI"+attacks on the parser. However, this ;TI"+limit can cause a legitimate parse to ;TI",fail and thus is set to +nil+, or off, ;TI"by default.;To;;[I" :converters;T; [o;
; [I"+An Array of names from the Converters ;TI",Hash and/or lambdas that handle custom ;TI"%conversion. A single converter ;TI"*doesn't have to be in an Array. All ;TI"*built-in converters try to transcode ;TI"(fields to UTF-8 before converting. ;TI"*The conversion will fail if the data ;TI"'cannot be transcoded, leaving the ;TI"field unchanged.;To;;[I"(:unconverted_fields;T; [o;
; [I"If set to +true+, an ;TI")unconverted_fields() method will be ;TI"*added to all returned rows (Array or ;TI"+CSV::Row) that will return the fields ;TI"+as they were before conversion. Note ;TI"(that :headers supplied by ;TI",Array or String were not fields of the ;TI"*document and thus will have an empty ;TI"Array attached.;To;;[I":headers;T; [o;
; [I"&If set to :first_row or ;TI"(+true+, the initial row of the CSV ;TI"&file will be treated as a row of ;TI"'headers. If set to an Array, the ;TI"+contents will be used as the headers. ;TI"+If set to a String, the String is run ;TI")through a call of CSV::parse_line() ;TI"&with the same :col_sep, ;TI":row_sep, and ;TI"+:quote_char as this instance ;TI"+to produce an Array of headers. This ;TI"*setting causes CSV#shift() to return ;TI")rows as CSV::Row objects instead of ;TI"%Arrays and CSV#read() to return ;TI",CSV::Table objects instead of an Array ;TI"of Arrays.;To;;[I"$:return_headers;T; [o;
; [I",When +false+, header rows are silently ;TI"*swallowed. If set to +true+, header ;TI",rows are returned in a CSV::Row object ;TI" with identical headers and ;TI",fields (save that the fields do not go ;TI"through the converters).;To;;[I"#:write_headers;T; [o;
; [I"*When +true+ and :headers is ;TI",set, a header row will be added to the ;TI"output.;To;;[I"':header_converters;T; [o;
; [
I"#Identical in functionality to ;TI"(:converters save that the ;TI")conversions are only made to header ;TI"+rows. All built-in converters try to ;TI"'transcode headers to UTF-8 before ;TI"+converting. The conversion will fail ;TI"'if the data cannot be transcoded, ;TI""leaving the header unchanged.;To;;[I"!:skip_blanks;T; [o;
; [I"*When set to a +true+ value, CSV will ;TI")skip over any empty rows. Note that ;TI"*this setting will not skip rows that ;TI"(contain column separators, even if ;TI")the rows contain no actual data. If ;TI"(you want to skip rows that contain ;TI")separators but no content, consider ;TI"$using :skip_lines, or ;TI")inspecting fields.compact.empty? on ;TI"each row.;To;;[I"":force_quotes;T; [o;
; [I"*When set to a +true+ value, CSV will ;TI"%quote all CSV fields it creates.;To;;[I" :skip_lines;T; [o;
; [I")When set to an object responding to ;TI")match, every line matching ;TI",it is considered a comment and ignored ;TI"+during parsing. When set to a String, ;TI"(it is first converted to a Regexp. ;TI"-When set to +nil+ no line is considered ;TI"*a comment. If the passed object does ;TI"$not respond to match, ;TI"&ArgumentError is thrown.;To;;[I"%:liberal_parsing;T; [o;
; [ I"*When set to a +true+ value, CSV will ;TI"+attempt to parse input not conformant ;TI"*with RFC 4180, such as double quotes ;TI"in unquoted fields.;T@o;
; [I"7See CSV::DEFAULT_OPTIONS for the default settings.;T@o;
; [I"SOptions cannot be overridden in the instance methods for performance reasons, ;TI"*so be sure to set what you want here.;T:
@fileI"lib/csv.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(data, options = Hash.new);T@øFI"CSV;TcRDoc::NormalClass00