[DOC] Tweaks for Array#length
authorBurdetteLamar <[email protected]>
Wed, 2 Oct 2024 16:12:09 +0000 (2 11:12 -0500)
committerPeter Zhu <[email protected]>
Wed, 2 Oct 2024 17:19:27 +0000 (2 13:19 -0400)
array.c

diff --git a/array.c b/array.c
index 103658f..fca9976 100644 (file)
--- a/array.c
+++ b/array.c
@@ -2725,9 +2725,15 @@ rb_ary_reverse_each(VALUE ary)
 
 /*
  *  call-seq:
- *    array.length -> an_integer
+ *    length -> integer
+ *    size -> integer
  *
- *  Returns the count of elements in +self+.
+ *  Returns the count of elements in +self+:
+ *
+ *    [0, 1, 2].length # => 3
+ *    [].length        # => 0
+ *
+ *  Related: see {Methods for Querying}[rdoc-ref:Array@Methods+for+Querying].
  */
 
 static VALUE