method
select
v1_9_3_125 -
Show latest stable
- Class:
Enumerable
select()public
Returns an array containing all elements of enum for which block is not false (see also Enumerable#reject).
If no block is given, an enumerator is returned instead.
(1..10).find_all {|i| i % 3 == 0 } #=> [3, 6, 9]