Array
ruby/spec describes 121 methods in core/array, and Metorex implements 121 of them. The parameters are what Method#parameters answers under Metorex.
Array#&: implemented, parameters[[:req]]. Returns a new array containing the intersection ofselfandother_array; that is, containing those elements found in bothselfandother_array:Array#*: implemented, parameters[[:req]]. When non-negative integer argumentnis given, returns a new array built by concatenatingncopies ofself:Array#+: implemented, parameters[[:req]]. Returns a new array containing all elements ofselffollowed by all elements ofother_array:Array#-: implemented, parameters[[:req]]. Returns a new array containing only those elements ofselfthat are not found inother_array; the order fromselfis preserved:Array#<<: implemented, parameters[[:req]]. Appendsobjectas the last element inself; returnsself:Array#<=>: implemented, parameters[[:req]]. Returns -1, 0, or 1 asselfis determined to be less than, equal to, or greater thanother_array.Array#==: implemented, parameters[[:req]]. Returns whether both:Array#[]: implemented, parameters[[:rest]]. Returns elements fromself; does not modifyself.Array.[]: implemented, parameters[[:req, :args]]. Returns a new array, populated with the given objects:Array#[]=: implemented, parameters[[:rest]]. Assigns elements inself, based on the givenobject; returnsobject.Array#all?: implemented, parameters[[:rest, :pattern]]. Returns whether for every element ofself, a given criterion is satisfied. An example calling it.Array.allocate: implemented, parameters[[:req, :args]]. An example calling it.Array#any?: implemented, parameters[[:rest, :pattern]]. Returns whether for any element ofself, a given criterion is satisfied. An example calling it.Array#append: implemented, parameters[[:rest]]. Appends each argument inobjectstoself; returnsself: An example calling it.Array#assoc: implemented, parameters[[:req]]. Returns the first elementeleinselfsuch thateleis an array andele[0] == object: An example calling it.Array#at: implemented, parameters[[:req]]. Returns the element ofselfspecified by the givenindexornilif there is no such element;indexmust be an integer-convertible object. An example calling it.Array#bsearch: implemented, parameters[]. Returns the element fromselffound by a binary search, ornilif the search found no suitable element. An example calling it.Array#bsearch_index: implemented, parameters[]. Returns the integer index of the element fromselffound by a binary search, ornilif the search found no suitable element. An example calling it.Array#clear: implemented, parameters[]. Removes all elements fromself; returnsself: An example calling it.Array#clone: implemented, parameters[[:rest, :args]]. Produces a shallow copy of obj---the instance variables of obj are copied, but not the objects they reference. An example calling it.Array#collect: implemented, parameters[[:block, :block]]. With a block given, calls the block with each element ofself; returns a new array whose elements are the return values from the block: An example calling it.Array#collect!: implemented, parameters[]. With a block given, calls the block with each element ofselfand replaces the element with the block's return value; returnsself:Array#combination: implemented, parameters[[:req, :count]]. When a block and a positive integer-convertible object argumentcount(0 < count <= self.size) are given, calls the block with each combination ofselfof sizecount; returnsself: An example calling it.Array#compact: implemented, parameters[]. Returns a new array containing only the non-nilelements fromself; element order is preserved: An example calling it.Array#compact!: implemented, parameters[]. Removes allnilelements fromself; Returnsselfif any elements are removed,nilotherwise: An example calling it.Array#concat: implemented, parameters[[:rest]]. Adds toselfall elements from each array inother_arrays; returnsself: An example calling it.Array#count: implemented, parameters[[:rest, :wanted]]. Returns a count of specified elements. An example calling it.Array#cycle: implemented, parameters[[:rest, :count]]. With a block given, may call the block, depending on the value of argumentcount;countmust be an integer-convertible object, ornil. An example calling it.Array#deconstruct: implemented, parameters[]. An example calling it.Array#delete: implemented, parameters[[:req]]. Removes zero or more elements fromself. An example calling it.Array#delete_at: implemented, parameters[[:req]]. Removes the element ofselfat the givenindex, which must be an integer-convertible object. An example calling it.Array#delete_if: implemented, parameters[]. With a block given, calls the block with each element ofself; removes the element if the block returns a truthy value; returnsself: An example calling it.Array#detect: implemented, parameters[[:opt, :if_none], [:block, :block]]. Returns the first element for which the block returns a truthy value. An example calling it.Array#difference: implemented, parameters[[:rest]]. Returns a new array containing only those elements fromselfthat are not found in any of the givenother_arrays; items are compared usingeql?; order fromselfis preserved: An example calling it.Array#dig: implemented, parameters[[:rest]]. Finds and returns the object in nested object specified byindexandidentifiers; the nested objects may be instances of various classes. An example calling it.Array#drop: implemented, parameters[[:req, :count]]. Returns a new array containing all but the firstcountelement ofself, wherecountis a non-negative integer; does not modifyself. An example calling it.Array#drop_while: implemented, parameters[]. With a block given, calls the block with each successive element ofself; stops if the block returnsfalseornil; returns a new array omitting those elements for which the block returned a truthy value; does not modifyself: An example calling it.Array#dup: implemented, parameters[]. Produces a shallow copy of obj---the instance variables of obj are copied, but not the objects they reference. An example calling it.Array#each: implemented, parameters[]. With a block given, iterates over the elements ofself, passing each element to the block; returnsself: An example calling it.Array#each_index: implemented, parameters[]. With a block given, iterates over the elements ofself, passing each array index to the block; returnsself: An example calling it.Array#empty?: implemented, parameters[]. Returnstrueif the count of elements inselfis zero,falseotherwise. An example calling it.Array#eql?: implemented, parameters[[:req]]. Returnstrueifselfandother_arrayare the same size, and if, for each indexiinself,self[i].eql?(other_array[i]): An example calling it.Array#fetch: implemented, parameters[[:rest]]. Returns the element ofselfat offsetindexifindexis in range;indexmust be an integer-convertible object. An example calling it.Array#fetch_values: implemented, parameters[[:rest, :args]]. With no block given, returns a new array containing the elements ofselfat the offsets specified byindexes. An example calling it.Array#fill: implemented, parameters[[:rest, :given], [:block, :block]]. Replaces selected elements inself; may add elements toself; always returnsself(never a new array). An example calling it.Array#filter: implemented, parameters[[:block, :block]]. With a block given, calls the block with each element ofself; returns a new array containing those elements ofselffor which the block returns a truthy value: An example calling it.Array#filter!: implemented, parameters[]. With a block given, calls the block with each element ofself; removes fromselfthose elements for which the block returnsfalseornil.Array#find: implemented, parameters[[:opt, :if_none], [:block, :block]]. Returns the first element for which the block returns a truthy value. An example calling it.Array#find_index: implemented, parameters[[:rest, :wanted]]. Returns the zero-based integer index of a specified element, ornil. An example calling it.Array#first: implemented, parameters[[:rest, :count]]. Returns elements fromself, ornil; does not modifyself. An example calling it.Array#flatten: implemented, parameters[[:rest]]. Returns a new array that is a recursive flattening ofselftodepthlevels of recursion;depthmust be an integer-convertible object ornil. An example calling it.Array#flatten!: implemented, parameters[[:rest]]. Returnsselfas a recursively flattening ofselftodepthlevels of recursion;depthmust be an integer-convertible object, ornil. An example calling it.Array#frozen?: implemented, parameters[[:rest, :args]]. Returns the freeze status of obj. An example calling it.Array#hash: implemented, parameters[]. Returns the integer hash value forself. An example calling it.Array#include?: implemented, parameters[[:req, :wanted]]. Returns whether for some elementelementinself,object == element: An example calling it.Array#index: implemented, parameters[[:rest]]. Returns the zero-based integer index of a specified element, ornil. An example calling it.Array#initialize: implemented, parameters[[:rest]]. An example calling it.Array#insert: implemented, parameters[[:rest]]. Inserts the givenobjectsas elements ofself; returnsself. An example calling it.Array#inspect: implemented, parameters[]. Returns the new string formed by calling method#inspecton each array element: An example calling it.Array#intersect?: implemented, parameters[[:req]]. Returns whetherother_arrayhas at least one element that is#eql?to some element ofself: An example calling it.Array#intersection: implemented, parameters[[:rest]]. Returns a new array containing each element inselfthat is#eql?to at least one element in each of the givenother_arrays; duplicates are omitted: An example calling it.Array#join: implemented, parameters[[:rest]]. Returns the new string formed by joining the converted elements ofself; for each elementelement: An example calling it.Array#keep_if: implemented, parameters[]. With a block given, calls the block with each element ofself; removes the element fromselfif the block does not return a truthy value: An example calling it.Array#last: implemented, parameters[[:rest, :args]]. Returns elements fromself, ornil;selfis not modified. An example calling it.Array#length: implemented, parameters[]. Returns the count of elements inself: An example calling it.Array#map: implemented, parameters[[:block, :block]]. With a block given, calls the block with each element ofself; returns a new array whose elements are the return values from the block: An example calling it.Array#map!: implemented, parameters[]. With a block given, calls the block with each element ofselfand replaces the element with the block's return value; returnsself: An example calling it.Array#max: implemented, parameters[[:rest]]. Returns one of the following: An example calling it.Array#min: implemented, parameters[[:rest]]. Returns one of the following: An example calling it.Array#minmax: implemented, parameters[]. Returns a 2-element array containing the minimum-valued and maximum-valued elements fromself; does not modifyself. An example calling it.Array.new: implemented, parameters[[:rest]]. Returns a new array. An example calling it.Array#none?: implemented, parameters[[:rest, :pattern]]. Returnstrueif no element ofselfmeets a given criterion,falseotherwise. An example calling it.Array#one?: implemented, parameters[[:rest, :pattern]]. Returnstrueif exactly one element ofselfmeets a given criterion. An example calling it.Array#pack: implemented, parameters[[:rest, :args]]. Formats each element inselfinto a binary string; returns that string. An example calling it.Array#partition: implemented, parameters[]. With a block given, returns an array of two arrays: An example calling it.Array#permutation: implemented, parameters[[:opt, :count]]. Iterates over permutations of the elements ofself; the order of permutations is indeterminate. An example calling it.Array#pop: implemented, parameters[[:rest]]. Removes and returns trailing elements ofself. An example calling it.Array#prepend: implemented, parameters[[:rest]]. Prepends the givenobjectstoself: An example calling it.Array#product: implemented, parameters[[:rest, :lists]]. Computes all combinations of elements from all the arrays, including bothselfandother_arrays: An example calling it.Array#push: implemented, parameters[[:rest]]. Appends each argument inobjectstoself; returnsself: An example calling it.Array#rassoc: implemented, parameters[[:req]]. Returns the first elementeleinselfsuch thateleis an array andele[1] == object: An example calling it.Array#reject: implemented, parameters[]. With a block given, returns a new array whose elements are all those fromselffor which the block returnsfalseornil: An example calling it.Array#reject!: implemented, parameters[]. With a block given, calls the block with each element ofself; removes each element for which the block returns a truthy value. An example calling it.Array#repeated_combination: implemented, parameters[[:req, :count]]. With a block given, calls the block with each repeated combination of lengthsizeof the elements ofself; each combination is an array; returnsself. An example calling it.Array#repeated_permutation: implemented, parameters[[:req, :count]]. With a block given, calls the block with each repeated permutation of lengthsizeof the elements ofself; each permutation is an array; returnsself. An example calling it.Array#replace: implemented, parameters[[:req]]. Replaces the elements ofselfwith the elements ofother_array, which must be an array-convertible object; returnsself: An example calling it.Array#reverse: implemented, parameters[]. Returns a new array containing the elements ofselfin reverse order: An example calling it.Array#reverse!: implemented, parameters[]. Reverses the order of the elements ofself; returnsself: An example calling it.Array#reverse_each: implemented, parameters[[:block, :block]]. When a block given, iterates backwards over the elements ofself, passing, in reverse order, each element to the block; returnsself: An example calling it.Array#rfind: implemented, parameters[[:opt, :if_none]]. Returns the last element for which the block returns a truthy value. An example calling it.Array#rindex: implemented, parameters[[:rest]]. Returns the index of the last element for whichobject == element. An example calling it.Array#rotate: implemented, parameters[[:rest]]. Returns a new array formed fromselfwith elements rotated from one end to the other. An example calling it.Array#rotate!: implemented, parameters[[:rest]]. Rotatesselfin place by moving elements from one end to the other; returnsself.Array#sample: implemented, parameters[[:rest, :args]]. Returns random elements fromself, as selected by the object given by the keyword argumentrandom. An example calling it.Array#select: implemented, parameters[]. With a block given, calls the block with each element ofself; returns a new array containing those elements ofselffor which the block returns a truthy value: An example calling it.Array#select!: implemented, parameters[]. With a block given, calls the block with each element ofself; removes fromselfthose elements for which the block returnsfalseornil. An example calling it.Array#shift: implemented, parameters[[:rest]]. Removes and returns leading elements fromself. An example calling it.Array#shuffle: implemented, parameters[[:rest, :args]]. Returns a new array containing all elements fromselfin a random order, as selected by the object given by the keyword argumentrandom: An example calling it.Array#shuffle!: implemented, parameters[[:rest, :args]]. Shuffles all elements inselfinto a random order, as selected by the object given by the keyword argumentrandom.Array#size: implemented, parameters[]. Returns the count of elements inself: An example calling it.Array#slice: implemented, parameters[[:rest]]. Returns elements fromself; does not modifyself. An example calling it.Array#slice!: implemented, parameters[[:rest]]. Removes and returns elements fromself. An example calling it.Array#sort: implemented, parameters[[:block, :block]]. Returns a new array containing the elements ofself, sorted. An example calling it.Array#sort!: implemented, parameters[]. Like Array#sort, but returnsselfwith its elements sorted in place. An example calling it.Array#sort_by!: implemented, parameters[]. With a block given, sorts the elements ofselfin place; returns self. An example calling it.Array#sum: implemented, parameters[[:rest, :start]]. With no block given, returns the sum ofinitand all elements ofself; for arrayarrayand valueinit, equivalent to: An example calling it.Array#take: implemented, parameters[[:req, :count]]. Returns a new array containing the firstcountelement ofself(as available);countmust be a non-negative numeric; does not modifyself: An example calling it.Array#take_while: implemented, parameters[]. With a block given, calls the block with each successive element ofself; stops iterating if the block returnsfalseornil; returns a new array containing those elements for which the block returned a truthy value: An example calling it.Array#to_a: implemented, parameters[[:rest, :args]]. Whenselfis an instance of Array, returnsself. An example calling it.Array#to_ary: implemented, parameters[]. Returnsself. An example calling it.Array#to_h: implemented, parameters[[:block, :block]]. Returns a new hash formed fromself. An example calling it.Array#to_s: implemented, parameters[]. Returns the new string formed by calling method#inspecton each array element: An example calling it.Array#transpose: implemented, parameters[]. Returns a new array that isselfas a transposed matrix: An example calling it.Array.try_convert: implemented, parameters[[:req, :held]]. Attempts to return an array, based on the givenobject. An example calling it.Array#union: implemented, parameters[[:rest]]. Returns a new array that is the union of the elements ofselfand all given arraysother_arrays; items are compared usingeql?: An example calling it.Array#uniq: implemented, parameters[[:block, :block]]. Returns a new array containing those elements fromselfthat are not duplicates, the first occurrence always being retained. An example calling it.Array#uniq!: implemented, parameters[]. Removes duplicate elements fromself, the first occurrence always being retained; returnsselfif any elements removed,nilotherwise. An example calling it.Array#unshift: implemented, parameters[[:rest]]. Prepends the givenobjectstoself: An example calling it.Array#values_at: implemented, parameters[[:rest]]. Returns elements fromselfin a new array; does not modifyself. An example calling it.Array#zip: implemented, parameters[[:rest, :others]]. With no block given, combinesselfwith the collection ofother_arrays; returns a new array of sub-arrays: An example calling it.Array#|: implemented, parameters[[:req]]. Returns the union ofselfandother_array; duplicates are removed; order is preserved; items are compared usingeql?:
The method summaries are the first sentences of Ruby's own documentation for each method, read from MRI 4.0.6's ri data. Ruby's documentation is distributed under Ruby's license.