ruby-changes:53312
From: stomar <ko1@a...>
Date: Sun, 4 Nov 2018 20:40:36 +0900 (JST)
Subject: [ruby-changes:53312] stomar:r65528 (trunk): array.c: [DOC] add docs for Array#{filter, filter!}
stomar 2018-11-04 20:40:32 +0900 (Sun, 04 Nov 2018) New Revision: 65528 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65528 Log: array.c: [DOC] add docs for Array#{filter,filter!} Modified files: trunk/array.c Index: array.c =================================================================== --- array.c (revision 65527) +++ array.c (revision 65528) @@ -3139,6 +3139,8 @@ rb_ary_values_at(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/array.c#L3139 * call-seq: * ary.select {|item| block} -> new_ary * ary.select -> Enumerator + * ary.filter {|item| block} -> new_ary + * ary.filter -> Enumerator * * Returns a new array containing all elements of +ary+ * for which the given +block+ returns a true value. @@ -3151,6 +3153,8 @@ rb_ary_values_at(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/array.c#L3153 * a.select {|v| v =~ /[aeiou]/ } #=> ["a", "e"] * * See also Enumerable#select. + * + * Array#filter is an alias for Array#select. */ static VALUE @@ -3217,6 +3221,8 @@ select_bang_ensure(VALUE a) https://github.com/ruby/ruby/blob/trunk/array.c#L3221 * call-seq: * ary.select! {|item| block } -> ary or nil * ary.select! -> Enumerator + * ary.filter! {|item| block } -> ary or nil + * ary.filter! -> Enumerator * * Invokes the given block passing in successive elements from +self+, * deleting elements for which the block returns a +false+ value. @@ -3228,6 +3234,8 @@ select_bang_ensure(VALUE a) https://github.com/ruby/ruby/blob/trunk/array.c#L3234 * If no block is given, an Enumerator is returned instead. * * See also Array#keep_if. + * + * Array#filter! is an alias for Array#select!. */ static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/