Skip to content

Commit

Permalink
[DOC] Tweaks for Array#replace
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdetteLamar authored and peterzhu2118 committed Sep 29, 2024
1 parent 3986b5f commit 01ff65a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -4604,13 +4604,17 @@ rb_ary_transpose(VALUE ary)

/*
* call-seq:
* array.replace(other_array) -> self
* initialize_copy(other_array) -> self
* replace(other_array) -> self
*
* Replaces the content of +self+ with the content of +other_array+; returns +self+:
* Replaces the elements of +self+ with the elements of +other_array+, which must be an
* {array-convertible object}[rdoc-ref:implicit_conversion.rdoc@Array-Convertible+Objects];
* returns +self+:
*
* a = [:foo, 'bar', 2]
* a.replace(['foo', :bar, 3]) # => ["foo", :bar, 3]
* a = ['a', 'b', 'c'] # => ["a", "b", "c"]
* a.replace(['d', 'e']) # => ["d", "e"]
*
* Related: see {Methods for Assigning}[rdoc-ref:Array@Methods+for+Assigning].
*/

VALUE
Expand Down

0 comments on commit 01ff65a

Please sign in to comment.