Skip to content

Commit 1ae1b85

Browse files
author
zzak
committed
* array.c (rb_ary_select):
Update documentation for Array#select * enum.c (enum_find_all, enum_reject): Update documentation for Enumerable#find_all and Enumerable#reject Based on a patch by Jeff Saracco [Bug #6908] [ruby-core:47285] [Fixes #166 on github] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 7a0d7e7 commit 1ae1b85

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Fri Sep 14 03:30:00 2012 Zachary Scott <zzak@ruby-lang.org>
2+
3+
* array.c (rb_ary_select):
4+
Update documentation for Array#select
5+
* enum.c (enum_find_all, enum_reject):
6+
Update documentation for Enumerable#find_all and Enumerable#reject
7+
Based on a patch by Jeff Saracco
8+
[Bug #6908] [ruby-core:47285] [Fixes #166 on github]
9+
110
Fri Sep 14 00:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
211

312
* signal.c (rb_f_kill):

array.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,16 +2408,17 @@ rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
24082408
* ary.select { |item| block } -> new_ary
24092409
* ary.select -> Enumerator
24102410
*
2411-
* Invokes the given block passing in successive elements from +self+,
2412-
* returning an array containing those elements for which the block returns
2413-
* a +true+ value.
2414-
*
2415-
* See also Enumerable#select.
2411+
* Returns a new array containing all elements of +ary+
2412+
* for which the given +block+ returns a true value.
24162413
*
24172414
* If no block is given, an Enumerator is returned instead.
24182415
*
2416+
* [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
2417+
*
24192418
* a = %w{ a b c d e f }
24202419
* a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
2420+
*
2421+
* See also Enumerable#select.
24212422
*/
24222423

24232424
static VALUE

enum.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,17 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
311311
* enum.find_all -> an_enumerator
312312
* enum.select -> an_enumerator
313313
*
314-
* Returns an array containing all elements of <i>enum</i> for which
315-
* <em>block</em> is not <code>false</code> (see also
316-
* <code>Enumerable#reject</code>).
314+
* Returns an array containing all elements of +enum+
315+
* for which the given +block+ returns a true value.
317316
*
318-
* If no block is given, an enumerator is returned instead.
317+
* If no block is given, an Enumerator is returned instead.
319318
*
320319
*
321320
* (1..10).find_all { |i| i % 3 == 0 } #=> [3, 6, 9]
322321
*
322+
* [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
323+
*
324+
* See also Enumerable#reject.
323325
*/
324326

325327
static VALUE
@@ -351,13 +353,16 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
351353
* enum.reject { |obj| block } -> array
352354
* enum.reject -> an_enumerator
353355
*
354-
* Returns an array for all elements of <i>enum</i> for which
355-
* <em>block</em> is false (see also <code>Enumerable#find_all</code>).
356+
* Returns an array for all elements of +enum+ for which the given
357+
* +block+ returns false.
356358
*
357-
* If no block is given, an enumerator is returned instead.
359+
* If no block is given, an Enumerator is returned instead.
358360
*
359361
* (1..10).reject { |i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10]
360362
*
363+
* [1, 2, 3, 4, 5].reject { |num| num.even? } #=> [1, 3, 5]
364+
*
365+
* See also Enumerable#find_all.
361366
*/
362367

363368
static VALUE

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy