📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 03:50:07
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
Array
📍 /opt/alt/ruby31/share/ri/system/Array
🔄 Refresh
✏️
Editing: cdesc-Array.ri
Read Only
U:RDoc::NormalClass[iI" Array:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[�o:RDoc::Markup::Paragraph;[I"EAn \Array is an ordered, integer-indexed collection of objects, ;TI"=called _elements_. Any object may be an \Array element.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"\Array Indexes;T@o; ;[I"2\Array indexing starts at 0, as in C or Java.;T@o; ;[I":A positive index is an offset from the first element:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I")Index 0 indicates the first element.;To;;0;[o; ;[I"*Index 1 indicates the second element.;To;;0;[o; ;[I"...;T@o; ;[I"IA negative index is an offset, backwards, from the end of the array:;To;;;;[o;;0;[o; ;[I")Index -1 indicates the last element.;To;;0;[o; ;[I"1Index -2 indicates the next-to-last element.;To;;0;[o; ;[I"...;T@o; ;[I"CA non-negative index is <i>in range</i> if it is smaller than ;TI"3the size of the array. For a 3-element array:;To;;;;[o;;0;[o; ;[I"&Indexes 0 through 2 are in range.;To;;0;[o; ;[I"Index 3 is out of range.;T@o; ;[I"BA negative index is <i>in range</i> if its absolute value is ;TI"Cnot larger than the size of the array. For a 3-element array:;To;;;;[o;;0;[o; ;[I"(Indexes -1 through -3 are in range.;To;;0;[o; ;[I"Index -4 is out of range.;T@S;;i; I"Creating Arrays;T@o; ;[I"5You can create an \Array object explicitly with:;T@o;;;;[o;;0;[o; ;[I"LAn {array literal}[doc/syntax/literals_rdoc.html#label-Array+Literals].;T@o; ;[I"4You can convert certain objects to Arrays with:;T@o;;;;[o;;0;[o; ;[I"1\Method {Array}[Kernel.html#method-i-Array].;T@o; ;[I"<An \Array can contain different types of objects. For ;TI"Hexample, the array below contains an Integer, a String and a Float:;T@o:RDoc::Markup::Verbatim;[I"/ary = [1, "two", 3.0] #=> [1, "two", 3.0] ;T:@format0o; ;[I"FAn array can also be created by calling Array.new with zero, one ;TI"N(the initial size of the Array) or two arguments (the initial size and a ;TI"default object).;T@o;;[I"ary = Array.new #=> [] ;TI",Array.new(3) #=> [nil, nil, nil] ;TI"/Array.new(3, true) #=> [true, true, true] ;T;0o; ;[ I"NNote that the second argument populates the array with references to the ;TI"Osame object. Therefore, it is only recommended in cases when you need to ;TI"Iinstantiate arrays with natively immutable objects such as Symbols, ;TI"numbers, true or false.;T@o; ;[I"MTo create an array with separate objects a block can be passed instead. ;TI"PThis method is safe to use with mutable objects such as hashes, strings or ;TI"other arrays:;T@o;;[I"5Array.new(4) {Hash.new} #=> [{}, {}, {}, {}] ;TI"9Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"] ;T;0o; ;[I"CThis is also a quick way to build up multi-dimensional arrays:;T@o;;[I"/empty_table = Array.new(3) {Array.new(3)} ;TI"=#=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]] ;T;0o; ;[I"KAn array can also be created by using the Array() method, provided by ;TI"EKernel, which tries to call #to_ary, then #to_a on its argument.;T@o;;[I">Array({:a => "a", :b => "b"}) #=> [[:a, "a"], [:b, "b"]] ;T;0S;;i; I"Example Usage;T@o; ;[I"OIn addition to the methods it mixes in through the Enumerable module, the ;TI"PArray class has proprietary methods for accessing, searching and otherwise ;TI"manipulating arrays.;T@o; ;[I"8Some of the more common ones are illustrated below.;T@S;;i; I"Accessing Elements;T@o; ;[ I"NElements in an array can be retrieved using the Array#[] method. It can ;TI"Ktake a single integer argument (a numeric index), a pair of arguments ;TI"R(start and length) or a range. Negative indices start counting from the end, ;TI"$with -1 being the last element.;T@o;;[I"arr = [1, 2, 3, 4, 5, 6] ;TI"arr[2] #=> 3 ;TI"arr[100] #=> nil ;TI"arr[-3] #=> 4 ;TI"arr[2, 3] #=> [3, 4, 5] ;TI" arr[1..4] #=> [2, 3, 4, 5] ;TI"arr[1..-3] #=> [2, 3, 4] ;T;0o; ;[I"PAnother way to access a particular array element is by using the #at method;T@o;;[I"arr.at(0) #=> 1 ;T;0o; ;[I"@The #slice method works in an identical manner to Array#[].;T@o; ;[I"JTo raise an error for indices outside of the array bounds or else to ;TI"Cprovide a default value when that happens, you can use #fetch.;T@o;;[I"*arr = ['a', 'b', 'c', 'd', 'e', 'f'] ;TI"Narr.fetch(100) #=> IndexError: index 100 outside of array bounds: -6...6 ;TI"'arr.fetch(100, "oops") #=> "oops" ;T;0o; ;[I"IThe special methods #first and #last will return the first and last ;TI"(elements of an array, respectively.;T@o;;[I"arr.first #=> 1 ;TI"arr.last #=> 6 ;T;0o; ;[I"<To return the first +n+ elements of an array, use #take;T@o;;[I"arr.take(3) #=> [1, 2, 3] ;T;0o; ;[I"K#drop does the opposite of #take, by returning the elements after +n+ ;TI" elements have been dropped:;T@o;;[I"arr.drop(3) #=> [4, 5, 6] ;T;0S;;i; I")Obtaining Information about an Array;T@o; ;[I"LArrays keep track of their own length at all times. To query an array ;TI"Labout the number of elements it contains, use #length, #count or #size.;T@o;;[I"?browsers = ['Chrome', 'Firefox', 'Safari', 'Opera', 'IE'] ;TI"browsers.length #=> 5 ;TI"browsers.count #=> 5 ;T;0o; ;[I";To check whether an array contains any elements at all;T@o;;[I"browsers.empty? #=> false ;T;0o; ;[I"@To check whether a particular item is included in the array;T@o;;[I".browsers.include?('Konqueror') #=> false ;T;0S;;i; I"Adding Items to Arrays;T@o; ;[I"KItems can be added to the end of an array by using either #push or #<<;T@o;;[I"arr = [1, 2, 3, 4] ;TI"%arr.push(5) #=> [1, 2, 3, 4, 5] ;TI"(arr << 6 #=> [1, 2, 3, 4, 5, 6] ;T;0o; ;[I"?#unshift will add a new item to the beginning of an array.;T@o;;[I".arr.unshift(0) #=> [0, 1, 2, 3, 4, 5, 6] ;T;0o; ;[I"HWith #insert you can add a new element to an array at any position.;T@o;;[I"@arr.insert(3, 'apple') #=> [0, 1, 2, 'apple', 3, 4, 5, 6] ;T;0o; ;[I"KUsing the #insert method, you can also insert multiple values at once:;T@o;;[I"3arr.insert(3, 'orange', 'pear', 'grapefruit') ;TI"H#=> [0, 1, 2, "orange", "pear", "grapefruit", "apple", 3, 4, 5, 6] ;T;0S;;i; I"!Removing Items from an Array;T@o; ;[I"IThe method #pop removes the last element in an array and returns it:;T@o;;[I"arr = [1, 2, 3, 4, 5, 6] ;TI"arr.pop #=> 6 ;TI"arr #=> [1, 2, 3, 4, 5] ;T;0o; ;[I"HTo retrieve and at the same time remove the first item, use #shift:;T@o;;[I"arr.shift #=> 1 ;TI"arr #=> [2, 3, 4, 5] ;T;0o; ;[I"0To delete an element at a particular index:;T@o;;[I"arr.delete_at(2) #=> 4 ;TI"arr #=> [2, 3, 5] ;T;0o; ;[I"FTo delete a particular element anywhere in an array, use #delete:;T@o;;[I"arr = [1, 2, 2, 3] ;TI"arr.delete(2) #=> 2 ;TI"arr #=> [1,3] ;T;0o; ;[I"IA useful method if you need to remove +nil+ values from an array is ;TI"#compact:;T@o;;[ I"1arr = ['foo', 0, nil, 'bar', 7, 'baz', nil] ;TI"2arr.compact #=> ['foo', 0, 'bar', 7, 'baz'] ;TI"<arr #=> ['foo', 0, nil, 'bar', 7, 'baz', nil] ;TI"2arr.compact! #=> ['foo', 0, 'bar', 7, 'baz'] ;TI"2arr #=> ['foo', 0, 'bar', 7, 'baz'] ;T;0o; ;[I"GAnother common need is to remove duplicate elements from an array.;T@o; ;[I"DIt has the non-destructive #uniq, and destructive method #uniq!;T@o;;[I"3arr = [2, 5, 6, 556, 6, 6, 8, 9, 0, 123, 556] ;TI"/arr.uniq #=> [2, 5, 6, 556, 8, 9, 0, 123] ;T;0S;;i; I"Iterating over Arrays;T@o; ;[ I"LLike all classes that include the Enumerable module, Array has an each ;TI"Nmethod, which defines what elements should be iterated over and how. In ;TI"Ncase of Array's #each, all elements in the Array instance are yielded to ;TI"$the supplied block in sequence.;T@o; ;[I"9Note that this operation leaves the array unchanged.;T@o;;[ I"arr = [1, 2, 3, 4, 5] ;TI"'arr.each {|a| print a -= 10, " "} ;TI"# prints: -9 -8 -7 -6 -5 ;TI"#=> [1, 2, 3, 4, 5] ;T;0o; ;[I"PAnother sometimes useful iterator is #reverse_each which will iterate over ;TI"0the elements in the array in reverse order.;T@o;;[ I"7words = %w[first second third fourth fifth sixth] ;TI"str = "" ;TI"3words.reverse_each {|word| str += "#{word} "} ;TI"8p str #=> "sixth fifth fourth third second first " ;T;0o; ;[I"MThe #map method can be used to create a new array based on the original ;TI"?array, but with the values modified by the supplied block:;T@o;;[ I"0arr.map {|a| 2*a} #=> [2, 4, 6, 8, 10] ;TI"/arr #=> [1, 2, 3, 4, 5] ;TI"1arr.map! {|a| a**2} #=> [1, 4, 9, 16, 25] ;TI"1arr #=> [1, 4, 9, 16, 25] ;T;0S;;i; I""Selecting Items from an Array;T@o; ;[ I"OElements can be selected from an array according to criteria defined in a ;TI"Lblock. The selection can happen in a destructive or a non-destructive ;TI"Omanner. While the destructive operations will modify the array they were ;TI"Pcalled on, the non-destructive methods usually return a new array with the ;TI"?selected elements, but leave the original array unchanged.;T@S;;i; I"Non-destructive Selection;T@o;;[ I"arr = [1, 2, 3, 4, 5, 6] ;TI"0arr.select {|a| a > 3} #=> [4, 5, 6] ;TI"3arr.reject {|a| a < 3} #=> [3, 4, 5, 6] ;TI"0arr.drop_while {|a| a < 4} #=> [4, 5, 6] ;TI"9arr #=> [1, 2, 3, 4, 5, 6] ;T;0S;;i; I"Destructive Selection;T@o; ;[I"P#select! and #reject! are the corresponding destructive methods to #select ;TI"and #reject;T@o; ;[I"LSimilar to #select vs. #reject, #delete_if and #keep_if have the exact ;TI"7opposite result when supplied with the same block:;T@o;;[I"/arr.delete_if {|a| a < 4} #=> [4, 5, 6] ;TI"/arr #=> [4, 5, 6] ;TI" ;TI"arr = [1, 2, 3, 4, 5, 6] ;TI"-arr.keep_if {|a| a < 4} #=> [1, 2, 3] ;TI"-arr #=> [1, 2, 3] ;T;0S;;i; I"What's Here;T@o; ;[I",First, what's elsewhere. \Class \Array:;T@o;;;;[o;;0;[o; ;[I"PInherits from {class Object}[Object.html#class-Object-label-What-27s+Here].;To;;0;[o; ;[I"ZIncludes {module Enumerable}[Enumerable.html#module-Enumerable-label-What-27s+Here], ;TI"1which provides dozens of additional methods.;T@o; ;[I"=Here, class \Array provides methods that are useful for:;T@o;;;;[o;;0;[o; ;[I"J{Creating an Array}[#class-Array-label-Methods+for+Creating+an+Array];To;;0;[o; ;[I"8{Querying}[#class-Array-label-Methods+for+Querying];To;;0;[o; ;[I":{Comparing}[#class-Array-label-Methods+for+Comparing];To;;0;[o; ;[I"8{Fetching}[#class-Array-label-Methods+for+Fetching];To;;0;[o; ;[I":{Assigning}[#class-Array-label-Methods+for+Assigning];To;;0;[o; ;[I"8{Deleting}[#class-Array-label-Methods+for+Deleting];To;;0;[o; ;[I":{Combining}[#class-Array-label-Methods+for+Combining];To;;0;[o; ;[I":{Iterating}[#class-Array-label-Methods+for+Iterating];To;;0;[o; ;[I"<{Converting}[#class-Array-label-Methods+for+Converting];To;;0;[o; ;[I"5{And more....}[#class-Array-label-Other+Methods];T@S;;i; I""Methods for Creating an Array;T@o;;: NOTE;[o;;[I" ::[];T;[o; ;[I"6Returns a new array populated with given objects.;To;;[I" ::new;T;[o; ;[I"Returns a new array.;To;;[I"::try_convert;T;[o; ;[I"5Returns a new array created from a given object.;T@S;;i; I"Methods for Querying;T@o;;;;[o;;[I"#length, #size;T;[o; ;[I"#Returns the count of elements.;To;;[I"#include?;T;[o; ;[I"<Returns whether any element <tt>==</tt> a given object.;To;;[I"#empty?;T;[o; ;[I"+Returns whether there are no elements.;To;;[I" #all?;T;[o; ;[I"9Returns whether all elements meet a given criterion.;To;;[I" #any?;T;[o; ;[I"9Returns whether any element meets a given criterion.;To;;[I"#none?;T;[o; ;[I";Returns whether no element <tt>==</tt> a given object.;To;;[I" #one?;T;[o; ;[I"DReturns whether exactly one element <tt>==</tt> a given object.;To;;[I"#count;T;[o; ;[I"?Returns the count of elements that meet a given criterion.;To;;[I"#find_index, #index;T;[o; ;[I"IReturns the index of the first element that meets a given criterion.;To;;[I"#rindex;T;[o; ;[I"HReturns the index of the last element that meets a given criterion.;To;;[I" #hash;T;[o; ;[I"#Returns the integer hash code.;T@S;;i; I"Methods for Comparing;To;;;;[o;;[I"{#<=>}[#method-i-3C-3D-3E];T;[o; ;[I"Returns -1, 0, or 1 ;TI"Fas +self+ is less than, equal to, or greater than a given object.;To;;[I"{#==}[#method-i-3D-3D];T;[o; ;[I"BReturns whether each element in +self+ is <tt>==</tt> to the ;TI"-corresponding element in a given object.;To;;[I" #eql?;T;[o; ;[I"RReturns whether each element in +self+ is <tt>eql?</tt> to the corresponding ;TI"element in a given object.;T@S;;i; I"Methods for Fetching;T@o; ;[I"(These methods do not modify +self+.;T@o;;;;[ o;;[I"#[];T;[o; ;[I""Returns one or more elements.;To;;[I"#fetch;T;[o; ;[I"+Returns the element at a given offset.;To;;[I"#first;T;[o; ;[I"*Returns one or more leading elements.;To;;[I" #last;T;[o; ;[I"+Returns one or more trailing elements.;To;;[I" #max;T;[o; ;[I"2Returns one or more maximum-valued elements, ;TI"4as determined by <tt><=></tt> or a given block.;To;;[I" #max;T;[o; ;[I"2Returns one or more minimum-valued elements, ;TI"4as determined by <tt><=></tt> or a given block.;To;;[I"#minmax;T;[o; ;[I"=Returns the minimum-valued and maximum-valued elements, ;TI"4as determined by <tt><=></tt> or a given block.;To;;[I"#assoc;T;[o; ;[I"0Returns the first element that is an array ;TI"4whose first element <tt>==</tt> a given object.;To;;[I"#rassoc;T;[o; ;[I"0Returns the first element that is an array ;TI"5whose second element <tt>==</tt> a given object.;To;;[I"#at;T;[o; ;[I"+Returns the element at a given offset.;To;;[I"#values_at;T;[o; ;[I"+Returns the elements at given offsets.;To;;[I" #dig;T;[o; ;[I"*Returns the object in nested objects ;TI"Athat is specified by a given index and additional arguments.;To;;[I" #drop;T;[o; ;[I">Returns trailing elements as determined by a given index.;To;;[I" #take;T;[o; ;[I"=Returns leading elements as determined by a given index.;To;;[I"#drop_while;T;[o; ;[I">Returns trailing elements as determined by a given block.;To;;[I"#take_while;T;[o; ;[I"=Returns leading elements as determined by a given block.;To;;[I"#slice;T;[o; ;[I"DReturns consecutive elements as determined by a given argument.;To;;[I" #sort;T;[o; ;[I"RReturns all elements in an order determined by <tt><=></tt> or a given block.;To;;[I" #reverse;T;[o; ;[I"+Returns all elements in reverse order.;To;;[I" #compact;T;[o; ;[I"8Returns an array containing all non-+nil+ elements.;To;;[I"#select, #filter;T;[o; ;[I"DReturns an array containing elements selected by a given block.;To;;[I" #uniq;T;[o; ;[I"8Returns an array containing non-duplicate elements.;To;;[I"#rotate;T;[o; ;[I"FReturns all elements with some rotated from one end to the other.;To;;[I" #bsearch;T;[o; ;[I"5Returns an element selected via a binary search ;TI"$as determined by a given block.;To;;[I"#bsearch_index;T;[o; ;[I"BReturns the index of an element selected via a binary search ;TI"$as determined by a given block.;To;;[I"#sample;T;[o; ;[I")Returns one or more random elements.;To;;[I" #shuffle;T;[o; ;[I"(Returns elements in a random order.;T@S;;i; I"Methods for Assigning;T@o; ;[I"?These methods add, replace, or reorder elements in +self+.;T@o;;;;[o;;[I" #[]=;T;[o; ;[I"4Assigns specified elements with a given object.;To;;[I"#push, #append, #<<;T;[o; ;[I"Appends trailing elements.;To;;[I"#unshift, #prepend;T;[o; ;[I"Prepends leading elements.;To;;[I"#insert;T;[o; ;[I"HInserts given objects at a given offset; does not replace elements.;To;;[I"#concat;T;[o; ;[I",Appends all elements from given arrays.;To;;[I" #fill;T;[o; ;[I"8Replaces specified elements with specified objects.;To;;[I" #replace;T;[o; ;[I"FReplaces the content of +self+ with the content of a given array.;To;;[I"#reverse!;T;[o; ;[I"0Replaces +self+ with its elements reversed.;To;;[I" #rotate!;T;[o; ;[I"/Replaces +self+ with its elements rotated.;To;;[I"#shuffle!;T;[o; ;[I"7Replaces +self+ with its elements in random order.;To;;[I"#sort!;T;[o; ;[I"/Replaces +self+ with its elements sorted, ;TI"4as determined by <tt><=></tt> or a given block.;To;;[I"#sort_by!;T;[o; ;[I"NReplaces +self+ with its elements sorted, as determined by a given block.;T@S;;i; I"Methods for Deleting;T@o; ;[I"8Each of these methods removes elements from +self+:;T@o;;;;[o;;[I" #pop;T;[o; ;[I"*Removes and returns the last element.;To;;[I"#shift;T;[o; ;[I"+Removes and returns the first element.;To;;[I"#compact!;T;[o; ;[I"$Removes all non-+nil+ elements.;To;;[I"#delete;T;[o; ;[I".Removes elements equal to a given object.;To;;[I"#delete_at;T;[o; ;[I"+Removes the element at a given offset.;To;;[I"#delete_if;T;[o; ;[I"1Removes elements specified by a given block.;To;;[I" #keep_if;T;[o; ;[I"5Removes elements not specified by a given block.;To;;[I" #reject!;T;[o; ;[I"1Removes elements specified by a given block.;To;;[I"#select!, #filter!;T;[o; ;[I"5Removes elements not specified by a given block.;To;;[I"#slice!;T;[o; ;[I"0Removes and returns a sequence of elements.;To;;[I"#uniq!;T;[o; ;[I"Removes duplicates.;T@S;;i; I"Methods for Combining;T@o;;;;[ o;;[I"{#&}[#method-i-26];T;[o; ;[I"QReturns an array containing elements found both in +self+ and a given array.;To;;[I"#intersection;T;[o; ;[I"?Returns an array containing elements found both in +self+ ;TI"and in each given array.;To;;[I"#+;T;[o; ;[I"bReturns an array containing all elements of +self+ followed by all elements of a given array.;To;;[I"#-;T;[o; ;[I"]Returns an array containiing all elements of +self+ that are not found in a given array.;To;;[I"{#|}[#method-i-7C];T;[o; ;[I"[Returns an array containing all elements of +self+ and all elements of a given array, ;TI"duplicates removed.;To;;[I"#union;T;[o; ;[I"ZReturns an array containing all elements of +self+ and all elements of given arrays, ;TI"duplicates removed.;To;;[I"#difference;T;[o; ;[I"KReturns an array containing all elements of +self+ that are not found ;TI"!in any of the given arrays..;To;;[I" #product;T;[o; ;[I"QReturns or yields all combinations of elements from +self+ and given arrays.;T@S;;i; I"Methods for Iterating;T@o;;;;[ o;;[I" #each;T;[o; ;[I"*Passes each element to a given block.;To;;[I"#reverse_each;T;[o; ;[I"=Passes each element, in reverse order, to a given block.;To;;[I"#each_index;T;[o; ;[I"0Passes each element index to a given block.;To;;[I"#cycle;T;[o; ;[I"@Calls a given block with each element, then does so again, ;TI"1for a specified number of times, or forever.;To;;[I"#combination;T;[o; ;[I"BCalls a given block with combinations of elements of +self+; ;TI"@a combination does not use the same element more than once.;To;;[I"#permutation;T;[o; ;[I"BCalls a given block with permutations of elements of +self+; ;TI"@a permutation does not use the same element more than once.;To;;[I"#repeated_combination;T;[o; ;[I"BCalls a given block with combinations of elements of +self+; ;TI";a combination may use the same element more than once.;To;;[I"#repeated_permutation;T;[o; ;[I"BCalls a given block with permutations of elements of +self+; ;TI";a permutation may use the same element more than once.;T@S;;i; I"Methods for Converting;T@o;;;;[o;;[I"#map, #collect;T;[o; ;[I"IReturns an array containing the block return-value for each element.;To;;[I"#map!, #collect!;T;[o; ;[I"5Replaces each element with a block return-value.;To;;[I" #flatten;T;[o; ;[I"?Returns an array that is a recursive flattening of +self+.;To;;[I"#flatten!;T;[o; ;[I"LReplaces each nested array in +self+ with the elements from that array.;To;;[I"#inspect, #to_s;T;[o; ;[I"2Returns a new String containing the elements.;To;;[I" #join;T;[o; ;[I"PReturns a newsString containing the elements joined by the field separator.;To;;[I" #to_a;T;[o; ;[I";Returns +self+ or a new array containing all elements.;To;;[I"#to_ary;T;[o; ;[I"Returns +self+.;To;;[I" #to_h;T;[o; ;[I"1Returns a new hash formed from the elements.;To;;[I"#transpose;T;[o; ;[I"9Transposes +self+, which must be an array of arrays.;To;;[I" #zip;T;[o; ;[I"GReturns a new array of arrays containing +self+ and given arrays; ;TI"!follow the link for details.;T@S;;i; I"Other Methods;T@o;;;;[ o;;[I"#*;T;[o; ;[I""Returns one of the following:;To;;;;[o;;0;[o; ;[I"FWith integer argument +n+, a new array that is the concatenation ;TI"of +n+ copies of +self+.;To;;0;[o; ;[I"PWith string argument +field_separator+, a new string that is equivalent to ;TI"$<tt>join(field_separator)</tt>.;To;;[I"#abbrev;T;[o; ;[I">Returns a hash of unambiguous abbreviations for elements.;To;;[I" #pack;T;[o; ;[I"/Packs the elements into a binary sequence.;To;;[I" #sum;T;[o; ;[I"OReturns a sum of elements according to either <tt>+</tt> or a given block.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ;I" array.rb;T;0o;;[ ;I"lib/abbrev.rb;T;0o;;[ ;I"lib/racc/compat.rb;T;0o;;[ ;I"lib/shellwords.rb;T;0o;;[o; ;[I"for pack.c;T;I"pack.rb;T;0;0;0[ [ [[I"Enumerable;To;;[ ;@�;0I"array.c;T[[I" class;T[[:public[ [:protected[ [:private[[I"[];T@�[I"new;T@�[I"try_convert;T@�[I" instance;T[[;[ [;[ [;[t[I"&;T@�[I"*;T@�[I"+;T@�[I"-;T@�[I"<<;T@�[I"<=>;T@�[I"==;T@�[I"[];T@�[I"[]=;T@�[I"abbrev;TI"lib/abbrev.rb;T[I" all?;T@�[I" any?;T@�[I"append;T@�[I" assoc;T@�[I"at;T@�[I"bsearch;T@�[I"bsearch_index;T@�[I" clear;T@�[I"collect;T@�[I" collect!;T@�[I"combination;T@�[I"compact;T@�[I" compact!;T@�[I"concat;T@�[I" count;T@�[I" cycle;T@�[I"deconstruct;T@�[I"delete;T@�[I"delete_at;T@�[I"delete_if;T@�[I"difference;T@�[I"dig;T@�[I" drop;T@�[I"drop_while;T@�[I" each;T@�[I"each_index;T@�[I"empty?;T@�[I" eql?;T@�[I" fetch;T@�[I" fill;T@�[I"filter;T@�[I"filter!;T@�[I"find_index;T@�[I" first;T@�[I"flatten;T@�[I" flatten!;T@�[I" hash;T@�[I" include?;T@�[I" index;T@�[I"initialize_copy;T@�[I"insert;T@�[I"inspect;T@�[I"intersect?;T@�[I"intersection;T@�[I" join;T@�[I"keep_if;T@�[I" last;T@�[I"length;T@�[I"map;T@�[I" map!;T@�[I"max;T@�[I"min;T@�[I"minmax;T@�[I" none?;T@�[I" one?;T@�[I" pack;TI"pack.rb;T[I"permutation;T@�[I"pop;T@�[I"prepend;T@�[I"product;T@�[I" push;T@�[I"rassoc;T@�[I"reject;T@�[I"reject!;T@�[I"repeated_combination;T@�[I"repeated_permutation;T@�[I"replace;T@�[I"reverse;T@�[I" reverse!;T@�[I"reverse_each;T@�[I"rindex;T@�[I"rotate;T@�[I"rotate!;T@�[I"sample;TI" array.rb;T[I"select;T@�[I"select!;T@�[I"shelljoin;TI"lib/shellwords.rb;T[I" shift;T@�[I"shuffle;T@�[I" shuffle!;T@�[I" size;T@�[I" slice;T@�[I"slice!;T@�[I" sort;T@�[I" sort!;T@�[I" sort_by!;T@�[I"sum;T@�[I" take;T@�[I"take_while;T@�[I" to_a;T@�[I"to_ary;T@�[I" to_h;T@�[I" to_s;T@�[I"transpose;T@�[I" union;T@�[I" uniq;T@�[I" uniq!;T@�[I"unshift;T@�[I"values_at;T@�[I"zip;T@�[I"|;T@�[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"array.c;TI" array.rb;TI"lib/abbrev.rb;TI"lib/csv/core_ext/array.rb;TI"lib/mkmf.rb;TI"lib/pp.rb;TI"lib/racc/compat.rb;TI"lib/shellwords.rb;TI"pack.rb;T@�cRDoc::TopLevel
💾 Save Changes
❌ Cancel