[DOC] Tweaks for Array#reject

This commit is contained in:
BurdetteLamar 2024-10-08 15:37:49 -05:00 committed by Peter Zhu
parent 015d9ebaec
commit 0469d169e2
Notes: git 2024-10-08 20:57:36 +00:00

13
array.c
View File

@ -4367,21 +4367,19 @@ rb_ary_reject_bang(VALUE ary)
/*
* call-seq:
* array.reject {|element| ... } -> new_array
* array.reject -> new_enumerator
* reject {|element| ... } -> new_array
* reject -> new_enumerator
*
* Returns a new +Array+ whose elements are all those from +self+
* With a block given, returns a new array whose elements are all those from +self+
* for which the block returns +false+ or +nil+:
*
* a = [:foo, 'bar', 2, 'bat']
* a1 = a.reject {|element| element.to_s.start_with?('b') }
* a1 # => [:foo, 2]
*
* Returns a new Enumerator if no block given:
*
* a = [:foo, 'bar', 2]
* a.reject # => #<Enumerator: [:foo, "bar", 2]:reject>
* With no block given, returns a new Enumerator.
*
* Related: {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching].
*/
static VALUE
@ -8612,6 +8610,7 @@ rb_ary_deconstruct(VALUE ary)
* as determined by a given block.
* - #sample: Returns one or more random elements.
* - #shuffle: Returns elements in a random order.
* - #reject: Returns an array containing elements not rejected by a given block.
*
* === Methods for Assigning
*