From 01ff65af32a57fda3e9c993bad7761788260e2e5 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Fri, 27 Sep 2024 07:02:17 -0500 Subject: [PATCH] [DOC] Tweaks for Array#replace --- array.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/array.c b/array.c index fdd7775917..52b0fe6b99 100644 --- a/array.c +++ b/array.c @@ -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