⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.116
Server IP:
78.40.11.138
Server:
Linux tango.o2switch.net 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
alt
/
ruby30
/
share
/
ri
/
system
/
CSV
/
Row
/
View File Name :
fields-i.ri
U:RDoc::AnyMethod[iI"fields:ETI"CSV::Row#fields;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"RReturns field values per the given +specifiers+, which may be any mixture of:;To:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"\Integer index.;To;;0; [o; ; [I" \Range of \Integer indexes.;To;;0; [o; ; [I"52-element \Array containing a header and offset.;To;;0; [o; ; [I"Header.;To;;0; [o; ; [I"\Range of headers.;To:RDoc::Markup::BlankLine o; ; [I";For +specifier+ in one of the first four cases above, ;TI"Greturns the result of <tt>self.field(specifier)</tt>; see #field.;T@)o; ; [I"7Although there may be any number of +specifiers+, ;TI"5the examples here will illustrate one at a time.;T@)o; ; [I"0When the specifier is an \Integer +index+, ;TI"(returns <tt>self.field(index)</tt>L;To:RDoc::Markup::Verbatim; [ I".source = "Name,Name,Name\nFoo,Bar,Baz\n" ;TI".table = CSV.parse(source, headers: true) ;TI"row = table[0] ;TI" row.fields(1) # => ["Bar"] ;T:@format0o; ; [I":When the specifier is a \Range of \Integers +range+, ;TI"(returns <tt>self.field(range)</tt>:;To;; [I"*row.fields(1..2) # => ["Bar", "Baz"] ;T;0o; ; [I"7When the specifier is a 2-element \Array +array+, ;TI"(returns <tt>self.field(array)</tt>L;To;; [I"/row.fields('Name', 1) # => ["Foo", "Bar"] ;T;0o; ; [I".When the specifier is a header +header+, ;TI")returns <tt>self.field(header)</tt>L;To;; [I"%row.fields('Name') # => ["Foo"] ;T;0o; ; [ I"8When the specifier is a \Range of headers +range+, ;TI"8forms a new \Range +new_range+ from the indexes of ;TI"2<tt>range.start</tt> and <tt>range.end</tt>, ;TI"0and returns <tt>self.field(new_range)</tt>:;To;; [ I".source = "Name,NAME,name\nFoo,Bar,Baz\n" ;TI".table = CSV.parse(source, headers: true) ;TI"row = table[0] ;TI"4row.fields('Name'..'NAME') # => ["Foo", "Bar"] ;T;0o; ; [I"-Returns all fields if no argument given:;To;; [I"*row.fields # => ["Foo", "Bar", "Baz"];T;0: @fileI"lib/csv/row.rb;T:0@omit_headings_from_table_of_contents_below0I"self.fields(*specifiers) ;T0[[I"values_at;To;; [ ;@c;0I"(*headers_and_or_indices);T@cFI"Row;TcRDoc::NormalClass00