enum.reject { |obj| block } â array
enum.reject â an_enumerator
enum.reject â an_enumerator
Instance Public methods
Returns an array for all elements of enum
for which the given
block
returns false.
If no block is given, an Enumerator is returned instead.
(1..10).reject { |i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10] [1, 2, 3, 4, 5].reject { |num| num.even? } #=> [1, 3, 5]
See also #find_all.
Please login to continue.