Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,13 +2408,13 @@ 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.
* Returns a new array containing all elements of <i>ary</i>
* for which <em>block</em> returns a true value.
* (see also <code>Enumerable#select</code>).
*
* See also Enumerable#select.
* If no block is given, an enumerator is returned instead.
*
* 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"]
Expand Down
12 changes: 8 additions & 4 deletions enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,17 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
* enum.find_all -> an_enumerator
* enum.select -> an_enumerator
*
* Returns an array containing all elements of <i>enum</i> for which
* <em>block</em> is not <code>false</code> (see also
* <code>Enumerable#reject</code>).
* Returns an array containing all elements of <i>enum</i>
* for which <em>block</em> returns a true value.
* (see also <code>Enumerable#reject</code>).
*
* If no block is given, an enumerator is returned instead.
*
*
* (1..10).find_all { |i| i % 3 == 0 } #=> [3, 6, 9]
*
* [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
*
*/

static VALUE
Expand Down Expand Up @@ -352,12 +354,14 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
* enum.reject -> an_enumerator
*
* Returns an array for all elements of <i>enum</i> for which
* <em>block</em> is false (see also <code>Enumerable#find_all</code>).
* <em>block</em> returns false (see also <code>Enumerable#find_all</code>).
*
* 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]
*
*/

static VALUE
Expand Down