[DOC] Tweaks for Array#select!

This commit is contained in:
BurdetteLamar 2024-09-16 07:30:44 -05:00 committed by Peter Zhu
parent 4e17fa2906
commit 1c3981cb88
Notes: git 2024-09-16 16:33:58 +00:00

14
array.c
View File

@ -3934,10 +3934,12 @@ select_bang_ensure(VALUE a)
/* /*
* call-seq: * call-seq:
* array.select! {|element| ... } -> self or nil * select! {|element| ... } -> self or nil
* array.select! -> new_enumerator * select! -> new_enumerator
* filter! {|element| ... } -> self or nil
* filter! -> new_enumerator
* *
* Calls the block, if given with each element of +self+; * With a block given, calls the block with each element of +self+;
* removes from +self+ those elements for which the block returns +false+ or +nil+. * removes from +self+ those elements for which the block returns +false+ or +nil+.
* *
* Returns +self+ if any elements were removed: * Returns +self+ if any elements were removed:
@ -3947,11 +3949,9 @@ select_bang_ensure(VALUE a)
* *
* Returns +nil+ if no elements were removed. * Returns +nil+ if no elements were removed.
* *
* Returns a new Enumerator if no block given: * With no block given, returns a new Enumerator.
*
* a = [:foo, 'bar', 2, :bam]
* a.select! # => #<Enumerator: [:foo, "bar", 2, :bam]:select!>
* *
* Related: see {Methods for Deleting}[rdoc-ref:Array@Methods+for+Deleting].
*/ */
static VALUE static VALUE