File: //usr/share/ri/3.0.0/system/CSV/parse_line-c.ri
U:RDoc::AnyMethod[iI"parse_line:ETI"CSV::parse_line;TT:publico:RDoc::Markup::Document:@parts["o:RDoc::Markup::Paragraph; [I"LReturns the data created by parsing the first line of +string+ or +io+ ;TI"#using the specified +options+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I"3Argument +string+ should be a \String object; ;TI"Kit will be put into a new StringIO object positioned at the beginning.;To;;0; [o;
; [I"2Argument +io+ should be an IO object that is:;To;;
;;[o;;0; [o;
; [I"?Open for reading; on return, the IO object will be closed.;To;;0; [o;
; [I""Positioned at the beginning. ;TI"ETo position at the end, for appending, use method CSV.generate. ;TI"GFor any other positioning, pass a preset \StringIO object instead.;To;;0; [o;
; [I"XArgument +options+: see {Options for Parsing}[#class-CSV-label-Options+for+Parsing];T@S:RDoc::Markup::Heading:
leveli: textI"Without Option +headers+;T@o;
; [I"EWithout option +headers+, returns the first row as a new \Array.;T@o;
; [I".These examples assume prior execution of:;To:RDoc::Markup::Verbatim; [I"&string = "foo,0\nbar,1\nbaz,2\n"
;TI"path = 't.csv'
;TI"File.write(path, string)
;T:@format0o;
; [I"0Parse the first line from a \String object:;To;; [I".CSV.parse_line(string) # => ["foo", "0"]
;T;0o;
; [I"-Parse the first line from a File object:;To;; [I"File.open(path) do |file|
;TI". CSV.parse_line(file) # => ["foo", "0"]
;TI"end # => ["foo", "0"]
;T;0o;
; [I"7Returns +nil+ if the argument is an empty \String:;To;; [I"!CSV.parse_line('') # => nil
;T;0S;;i;I"With Option +headers+;T@o;
; [I"?With {option +headers+}[#class-CSV-label-Option+headers], ;TI"0returns the first row as a CSV::Row object.;T@o;
; [I".These examples assume prior execution of:;To;; [I"2string = "Name,Count\nfoo,0\nbar,1\nbaz,2\n"
;TI"path = 't.csv'
;TI"File.write(path, string)
;T;0o;
; [I"0Parse the first line from a \String object:;To;; [I"UCSV.parse_line(string, headers: true) # => #<CSV::Row "Name":"foo" "Count":"0">
;T;0o;
; [I"-Parse the first line from a File object:;To;; [I"File.open(path) do |file|
;TI"+ CSV.parse_line(file, headers: true)
;TI"3end # => #<CSV::Row "Name":"foo" "Count":"0">
;T;0S:RDoc::Markup::Rule:weighti@o;
; [I"2Raises an exception if the argument is +nil+:;To;; [I"7# Raises ArgumentError (Cannot parse nil as CSV):
;TI"CSV.parse_line(nil);T;0:
@fileI"lib/csv.rb;T:0@omit_headings_from_table_of_contents_below0I"<CSV.parse_line(string) -> new_array or nil
CSV.parse_line(io) -> new_array or nil
CSV.parse_line(string, **options) -> new_array or nil
CSV.parse_line(io, **options) -> new_array or nil
CSV.parse_line(string, headers: true, **options) -> csv_row or nil
CSV.parse_line(io, headers: true, **options) -> csv_row or nil
;T0[ I"(line, **options);T@uFI"CSV;TcRDoc::NormalClass00