[DOC] Fix call-seq consistency in Array
authorPeter Zhu <[email protected]>
Mon, 10 Feb 2025 19:29:52 +0000 (10 14:29 -0500)
committerPeter Zhu <[email protected]>
Mon, 10 Feb 2025 21:30:04 +0000 (10 16:30 -0500)
The documentation guide (https://docs.ruby-lang.org/en/master/contributing/documentation_guide_md.html#label-Calling+Sequence+-28for+methods+written+in+C-29)
says that the call-seq for instance methods should only include the method
name, no prepending `array.`.

array.c

diff --git a/array.c b/array.c
index 1d77615..e799c2f 100644 (file)
--- a/array.c
+++ b/array.c
@@ -2753,7 +2753,7 @@ rb_ary_length(VALUE ary)
 
 /*
  *  call-seq:
- *    array.empty?  -> true or false
+ *    empty?  -> true or false
  *
  *  Returns +true+ if the count of elements in +self+ is zero,
  *  +false+ otherwise.
@@ -2922,7 +2922,7 @@ rb_ary_join(VALUE ary, VALUE sep)
 
 /*
  *  call-seq:
- *    array.join(separator = $,) -> new_string
+ *    join(separator = $,) -> new_string
  *
  *  Returns the new string formed by joining the converted elements of +self+;
  *  for each element +element+:
@@ -3088,7 +3088,7 @@ rb_ary_to_h(VALUE ary)
 
 /*
  *  call-seq:
- *    array.to_ary -> self
+ *    to_ary -> self
  *
  *  Returns +self+.
  */
@@ -8012,7 +8012,7 @@ rb_ary_one_p(int argc, VALUE *argv, VALUE ary)
 
 /*
  *  call-seq:
- *    array.dig(index, *identifiers) -> object
+ *    dig(index, *identifiers) -> object
  *
  *  Finds and returns the object in nested object
  *  specified by +index+ and +identifiers+;