Enumerables Flashcards
returns true self == object, false otherwise
include?, member?
returns true if all elements meet a specified criterion, false otherwise
all?
returns true if any element meets a specified criterion, false otherwise
any?
returns the count of elements, based on an argument or block criterion, if given
count
returns a new hash containing the counts of each element
tally
return a specified number of leading elements
take
returns a specified number of trailing elements
drop
returns the elements whose values are smallest among the element, as determined by <=> or a given block
min
returns the elements whose values are largest among the elements, as determined by<=> or a given block
max
Returns a 2-element Array containing the smallest and largest elements.
minmax
Returns the smallest element, as determined by the given block.
min_by
Returns the largest element, as determined by the given block.
max_by
Returns an element selected by the block. find, detect
find, detect
Returns elements selected by the block.
find_all, filter, select
Returns the index of an element selected by a given object or block
find_index