diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -2408,16 +2408,17 @@ rb_ary_values_at(int argc, VALUE *argv, VALUE ary) * ary.select { |item| block } -> new_ary * ary.select -> Enumerator * - * Invokes the given block passing in successive elements from +self+, - * returning an array containing those elements for which the block returns - * a +true+ value. - * - * See also Enumerable#select. + * Returns a new array containing all elements of +ary+ + * for which the given +block+ returns a true value. * * If no block is given, an Enumerator is returned instead. * + * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4] + * * a = %w{ a b c d e f } * a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"] + * + * See also Enumerable#select. */ static VALUE |