⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
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 :
fetch-i.ri
U:RDoc::AnyMethod[iI" fetch:ETI"CSV::Row#fetch;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns the field value as specified by +header+.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Rule:weighti@o; ; [I"@With the single argument +header+, returns the field value ;TI"#for that header (first found):;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.fetch('Name') # => "Foo" ;T:@format0o; ; [I">Raises exception +KeyError+ if the header does not exist.;T@S;; i@o; ; [I"2With arguments +header+ and +default+ given, ;TI":returns the field value for the header (first found) ;TI"7if the header exists, otherwise returns +default+:;To;; [ I".source = "Name,Name,Name\nFoo,Bar,Baz\n" ;TI".table = CSV.parse(source, headers: true) ;TI"row = table[0] ;TI"&row.fetch('Name', '') # => "Foo" ;TI"$row.fetch(:nosuch, '') # => "" ;T;0S;; i@o; ; [ I"/With argument +header+ and a block given, ;TI":returns the field value for the header (first found) ;TI"5if the header exists; otherwise calls the block ;TI""and returns its return value:;To;; [ I".source = "Name,Name,Name\nFoo,Bar,Baz\n" ;TI".table = CSV.parse(source, headers: true) ;TI"row = table[0] ;TI"Crow.fetch('Name') {|header| fail 'Cannot happen' } # => "Foo" ;TI"crow.fetch(:nosuch) {|header| "Header '#{header} not found'" } # => "Header 'nosuch not found'";T;0: @fileI"lib/csv/row.rb;T:0@omit_headings_from_table_of_contents_below0I"Efetch(header) fetch(header, default) fetch(header) {|row| ... } ;TI"header;T[ I"(header, *varargs);T@8FI"Row;TcRDoc::NormalClass00