aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-04 11:39:28 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-04 11:39:28 +0000
commitbd20f031db80bb641c6527537ab3db831015730c (patch)
treeb1f596abf32fd24a472194caacf56444967c4e12 /array.c
parentf167ff47a606b1d00d38403b4da685395a91f2aa (diff)
downloadruby-bd20f031db80bb641c6527537ab3db831015730c.tar.gz
array.c: [DOC] improve Array#{select,select!,keep_if} docs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/array.c b/array.c
index c778a5fd1b..1eff5729c4 100644
--- a/array.c
+++ b/array.c
@@ -3145,10 +3145,10 @@ rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
*
* If no block is given, an Enumerator is returned instead.
*
- * [1,2,3,4,5].select {|num| num.even? } #=> [2, 4]
+ * [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"]
+ * a = %w[ a b c d e f ]
+ * a.select {|v| v =~ /[aeiou]/ } #=> ["a", "e"]
*
* See also Enumerable#select.
*/
@@ -3215,8 +3215,8 @@ select_bang_ensure(VALUE a)
/*
* call-seq:
- * ary.select! {|item| block } -> ary or nil
- * ary.select! -> Enumerator
+ * ary.select! {|item| block } -> ary or nil
+ * ary.select! -> Enumerator
*
* Invokes the given block passing in successive elements from +self+,
* deleting elements for which the block returns a +false+ value.
@@ -3225,10 +3225,9 @@ select_bang_ensure(VALUE a)
*
* If changes were made, it will return +self+, otherwise it returns +nil+.
*
- * See also Array#keep_if
- *
* If no block is given, an Enumerator is returned instead.
*
+ * See also Array#keep_if.
*/
static VALUE
@@ -3250,14 +3249,15 @@ rb_ary_select_bang(VALUE ary)
* ary.keep_if -> Enumerator
*
* Deletes every element of +self+ for which the given block evaluates to
- * +false+.
- *
- * See also Array#select!
+ * +false+, and returns +self+.
*
* If no block is given, an Enumerator is returned instead.
*
- * a = %w{ a b c d e f }
- * a.keep_if {|v| v =~ /[aeiou]/} #=> ["a", "e"]
+ * a = %w[ a b c d e f ]
+ * a.keep_if {|v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ * a #=> ["a", "e"]
+ *
+ * See also Array#select!.
*/
static VALUE