⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.127
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
CSV
/
Row
/
View File Name :
fields-i.ri
U:RDoc::AnyMethod[iI"fields:ETI"CSV::Row#fields;TF:publico: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
self.field(specifier)
; 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
self.field(index)
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
self.field(range)
:;To;; [I"*row.fields(1..2) # => ["Bar", "Baz"] ;T;0o; ; [I"7When the specifier is a 2-element \Array +array+, ;TI"(returns
self.field(array)
L;To;; [I"/row.fields('Name', 1) # => ["Foo", "Bar"] ;T;0o; ; [I".When the specifier is a header +header+, ;TI")returns
self.field(header)
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
range.start
and
range.end
, ;TI"0and returns
self.field(new_range)
:;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