⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.189
Server IP:
109.199.105.153
Server:
Linux connect.inboxifs.com 5.15.0-152-generic #162-Ubuntu SMP Wed Jul 23 09:48:42 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
CSV
/
Edit File: parse-c.ri
U:RDoc::AnyMethod[iI" parse:ETI"CSV::parse;TT:publico:RDoc::Markup::Document:@parts[@o:RDoc::Markup::Paragraph; [I";Parses +string+ or +io+ 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"FWithout {option +headers+}[#class-CSV-label-Option+headers] case.;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:@format0S:RDoc::Markup::Rule:weighti@o; ; [I"MWith no block given, returns an \Array of Arrays formed from the source.;T@o; ; [I"Parse a \String:;To;; [I" a_of_a = CSV.parse(string) ;TI"<a_of_a # => [["foo", "0"], ["bar", "1"], ["baz", "2"]] ;T;0o; ; [I"Parse an open \File:;To;; [ I"(a_of_a = File.open(path) do |file| ;TI" CSV.parse(file) ;TI" end ;TI"<a_of_a # => [["foo", "0"], ["bar", "1"], ["baz", "2"]] ;T;0S;;i@o; ; [I">With a block given, calls the block with each parsed row:;T@o; ; [I"Parse a \String:;To;; [I"&CSV.parse(string) {|row| p row } ;T;0o; ; [I"Output:;To;; [I"["foo", "0"] ;TI"["bar", "1"] ;TI"["baz", "2"] ;T;0o; ; [I"Parse an open \File:;To;; [I"File.open(path) do |file| ;TI"& CSV.parse(file) {|row| p row } ;TI" end ;T;0o; ; [I"Output:;To;; [I"["foo", "0"] ;TI"["bar", "1"] ;TI"["baz", "2"] ;T;0S;;i;I"With Option +headers+;T@o; ; [I"CWith {option +headers+}[#class-CSV-label-Option+headers] case.;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;0S;;i@o; ; [I"MWith no block given, returns a CSV::Table object formed from the source.;T@o; ; [I"Parse a \String:;To;; [I"?csv_table = CSV.parse(string, headers: ['Name', 'Count']) ;TI">csv_table # => #<CSV::Table mode:col_or_row row_count:5> ;T;0o; ; [I"Parse an open \File:;To;; [ I"+csv_table = File.open(path) do |file| ;TI"3 CSV.parse(file, headers: ['Name', 'Count']) ;TI" end ;TI">csv_table # => #<CSV::Table mode:col_or_row row_count:4> ;T;0S;;i@o; ; [I"?With a block given, calls the block with each parsed row, ;TI"2which has been formed into a CSV::Row object:;T@o; ; [I"Parse a \String:;To;; [I"BCSV.parse(string, headers: ['Name', 'Count']) {|row| p row } ;T;0o; ; [I"Output:;To;; [I"+# <CSV::Row "Name":"foo" "Count":"0"> ;TI"+# <CSV::Row "Name":"bar" "Count":"1"> ;TI"+# <CSV::Row "Name":"baz" "Count":"2"> ;T;0o; ; [I"Parse an open \File:;To;; [I"File.open(path) do |file| ;TI"B CSV.parse(file, headers: ['Name', 'Count']) {|row| p row } ;TI" end ;T;0o; ; [I"Output:;To;; [I"+# <CSV::Row "Name":"foo" "Count":"0"> ;TI"+# <CSV::Row "Name":"bar" "Count":"1"> ;TI"+# <CSV::Row "Name":"baz" "Count":"2"> ;T;0S;;i@o; ; [I"ORaises an exception if the argument is not a \String object or \IO object:;To;; [I"G# Raises NoMethodError (undefined method `close' for :foo:Symbol) ;TI"CSV.parse(:foo);T;0: @fileI"lib/csv.rb;T:0@omit_headings_from_table_of_contents_below0I"�parse(string) -> array_of_arrays parse(io) -> array_of_arrays parse(string, headers: ..., **options) -> csv_table parse(io, headers: ..., **options) -> csv_table parse(string, **options) {|row| ... } parse(io, **options) {|row| ... } ;T0[ I"(str, **options, &block);T@�FI"CSV;TcRDoc::NormalClass00
Simpan