📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 17:42:06
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
Array
📍 /opt/alt/ruby31/share/ri/system/Array
🔄 Refresh
✏️
Editing: values_at-i.ri
Read Only
U:RDoc::AnyMethod[iI"values_at:ETI"Array#values_at;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":Returns a new \Array whose elements are the elements ;TI"9of +self+ at the given \Integer or \Range +indexes+.;To:RDoc::Markup::BlankLine o; ; [I"FFor each positive +index+, returns the element at offset +index+:;To:RDoc::Markup::Verbatim; [I"a = [:foo, 'bar', 2] ;TI"&a.values_at(0, 2) # => [:foo, 2] ;TI"*a.values_at(0..1) # => [:foo, "bar"] ;T:@format0o; ; [I"=The given +indexes+ may be in any order, and may repeat:;To;; [I"a = [:foo, 'bar', 2] ;TI"?a.values_at(2, 0, 1, 0, 2) # => [2, :foo, "bar", :foo, 2] ;TI"7a.values_at(1, 0..2) # => ["bar", :foo, "bar", 2] ;T; 0o; ; [I"4Assigns +nil+ for an +index+ that is too large:;To;; [I"a = [:foo, 'bar', 2] ;TI":a.values_at(0, 3, 1, 3) # => [:foo, nil, "bar", nil] ;T; 0o; ; [I"6Returns a new empty \Array if no arguments given.;T@o; ; [I"JFor each negative +index+, counts backward from the end of the array:;To;; [I"a = [:foo, 'bar', 2] ;TI"(a.values_at(-1, -3) # => [2, :foo] ;T; 0o; ; [I"4Assigns +nil+ for an +index+ that is too small:;To;; [I"a = [:foo, 'bar', 2] ;TI"Ba.values_at(0, -5, 1, -6, 2) # => [:foo, nil, "bar", nil, 2] ;T; 0o; ; [I"5The given +indexes+ may have a mixture of signs:;To;; [I"a = [:foo, 'bar', 2] ;TI";a.values_at(0, -2, 1, -1) # => [:foo, "bar", "bar", 2];T; 0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I",array.values_at(*indexes) -> new_array ;T0[ I"(*args);T@?FI" Array;TcRDoc::NormalClass00
💾 Save Changes
❌ Cancel