[DOC] Tweaks for Array#delete

This commit is contained in:
BurdetteLamar 2024-09-09 10:10:00 -05:00 committed by Peter Zhu
parent 7ec51310d5
commit a723d48081
Notes: git 2024-09-10 19:38:59 +00:00

View File

@ -4015,14 +4015,14 @@ ary_resize_smaller(VALUE ary, long len)
/*
* call-seq:
* delete(object) -> last_deleted_object
* delete(object) {|element| ... } -> last_deleted_object or block_return
* delete(object) -> last_removed_object
* delete(object) {|element| ... } -> last_removed_object or block_return
*
* Removes zero or more elements from +self+.
*
* With no block given,
* removes from +self+ each element +ele+ such that <tt>ele == object</tt>;
* returns the last deleted element:
* returns the last removed element:
*
* a = [0, 1, 2, 2.0]
* a.delete(2) # => 2.0
@ -4036,7 +4036,7 @@ ary_resize_smaller(VALUE ary, long len)
* removes from +self+ each element +ele+ such that <tt>ele == object</tt>.
*
* If any such elements are found, ignores the block
* and returns the last deleted element:
* and returns the last removed element:
*
* a = [0, 1, 2, 2.0]
* a.delete(2) {|element| fail 'Cannot happen' } # => 2.0
@ -4048,7 +4048,6 @@ ary_resize_smaller(VALUE ary, long len)
* # => "Element 2 not found."
*
* Related: see {Methods for Deleting}[rdoc-ref:Array@Methods+for+Deleting].
*
*/
VALUE