HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/ri/3.0.0/system/Array/fetch-i.ri
U:RDoc::AnyMethod[iI"
fetch:ETI"Array#fetch;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I",Returns the element at offset  +index+.;To:RDoc::Markup::BlankLineo;
;	[I"0With the single \Integer argument +index+, ;TI"+returns the element at offset +index+:;To:RDoc::Markup::Verbatim;	[I"a = [:foo, 'bar', 2]
;TI"a.fetch(1) # => "bar"
;T:@format0o;
;	[I">If +index+ is negative, counts from the end of the array:;To;;	[I"a = [:foo, 'bar', 2]
;TI"a.fetch(-1) # => 2
;TI"a.fetch(-2) # => "bar"
;T;
0o;
;	[I"1With arguments +index+ and +default_value+, ;TI"Areturns the element at offset +index+ if index is in range, ;TI"'otherwise returns +default_value+:;To;;	[I"a = [:foo, 'bar', 2]
;TI" a.fetch(1, nil) # => "bar"
;T;
0o;
;	[I"(With argument +index+ and a block, ;TI"@returns the element at offset +index+ if index is in range ;TI"f(and the block is not called); otherwise calls the block with index and returns its return value:;T@o;;	[I"a = [:foo, 'bar', 2]
;TI"<a.fetch(1) {|index| raise 'Cannot happen' } # => "bar"
;TI"Da.fetch(50) {|index| "Value for #{index}" } # => "Value for 50";T;
0:
@fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"}array.fetch(index) -> element
array.fetch(index, default_value) -> element
array.fetch(index) {|index| ... } -> element
;T0[I"(p1, p2 = v2);T@2FI"
Array;TcRDoc::NormalClass00