find_all()
public
Returns an array containing all elements of enum for which
block is not false (see also Enumerable#reject).
(1..10).find_all {|i| i % 3 == 0 }
Show source
/*
* call-seq:
* enum.find_all {| obj | block } => array
* enum.select {| obj | block } => array
*
* Returns an array containing all elements of <i>enum</i> for which
* <em>block</em> is not <code>false</code> (see also
* <code>Enumerable
*
* (1..10).find_all {|i| i % 3 == 0 }
*
*/
static VALUE
enum_find_all(obj)
VALUE obj;
{
VALUE ary = rb_ary_new();
RETURN_ENUMERATOR(obj, 0, 0);
rb_iterate(rb_each, obj, find_all_i, ary);
return ary;
}