[DOC] Tweaks for Array#reverse
authorBurdetteLamar <[email protected]>
Wed, 9 Oct 2024 16:15:58 +0000 (9 11:15 -0500)
committerPeter Zhu <[email protected]>
Wed, 9 Oct 2024 17:54:54 +0000 (9 13:54 -0400)
array.c

diff --git a/array.c b/array.c
index a08a8fa..520d3f0 100644 (file)
--- a/array.c
+++ b/array.c
@@ -3140,14 +3140,13 @@ rb_ary_reverse_bang(VALUE ary)
 
 /*
  *  call-seq:
- *    array.reverse -> new_array
+ *    reverse -> new_array
  *
- *  Returns a new +Array+ with the elements of +self+ in reverse order:
+ *  Returns a new array containing the elements of +self+ in reverse order:
  *
- *    a = ['foo', 'bar', 'two']
- *    a1 = a.reverse
- *    a1 # => ["two", "bar", "foo"]
+ *    [0, 1, 2].reverse # => [2, 1, 0]
  *
+ *  Related: see {Methods for Combining}[rdoc-ref:Array@Methods+for+Combining].
  */
 
 static VALUE
@@ -8662,6 +8661,7 @@ rb_ary_deconstruct(VALUE ary)
  *  - #difference: Returns an array containing all elements of +self+ that are not found
  *    in any of the given arrays..
  *  - #product: Returns or yields all combinations of elements from +self+ and given arrays.
+ *  - #reverse: Returns an array containing all elements of +self+ in reverse order.
  *
  *  === Methods for Iterating
  *