[前][次][番号順一覧][スレッド一覧]

ruby-changes:62654

From: Burdette <ko1@a...>
Date: Thu, 20 Aug 2020 06:27:19 +0900 (JST)
Subject: [ruby-changes:62654] 63d213eb13 (master): Partial compliance with doc/method_documentation.rdoc (#3431)

https://git.ruby-lang.org/ruby.git/commit/?id=63d213eb13

From 63d213eb133da695a9a0a796106af4f9db89b063 Mon Sep 17 00:00:00 2001
From: Burdette Lamar <BurdetteLamar@Y...>
Date: Wed, 19 Aug 2020 16:26:40 -0500
Subject: Partial compliance with doc/method_documentation.rdoc (#3431)

Removes references to *-convertible thingies.

diff --git a/array.c b/array.c
index ae2a4fd..e29f17f 100644
--- a/array.c
+++ b/array.c
@@ -947,9 +947,7 @@ rb_check_to_array(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L947
  *
  *  Tries to convert +object+ to an \Array.
  *
- *  When +object+ is an
- *  {Array-convertible object}[doc/implicit_conversion_rdoc.html#label-Array-Convertible+Objects]
- *  (implements +to_ary+),
+ *  When +object+ is an \Array,
  *  returns the \Array object created by converting it:
  *
  *    class ToAryReturnsArray < Set
@@ -960,9 +958,7 @@ rb_check_to_array(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L958
  *    as = ToAryReturnsArray.new([:foo, :bar, :baz])
  *    Array.try_convert(as) # => [:foo, :bar, :baz]
  *
- *  Returns +nil+ if +object+ is not \Array-convertible:
- *
- *    Array.try_convert(:foo) # => nil
+ *  Returns +nil+ if +object+ is not an Array.
  */
 
 static VALUE
@@ -981,14 +977,8 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L977
  *
  *  Returns a new \Array.
  *
- *  Argument +array+, if given, must be an
- *  {Array-convertible object}[doc/implicit_conversion_rdoc.html#label-Array-Convertible+Objects]
- *  (implements +to_ary+).
- *
- *  Argument +size+, if given must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects]
- *  (implements +to_int+).
- *
+ *  Argument +array+, if given, must be an \Array.
+ *  Argument +size+, if given must be an \Integer.
  *  Argument +default_value+ may be any object.
  *
  *  ---
@@ -1058,11 +1048,7 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1048
  *    # Raises ArgumentError (negative array size):
  *    Array.new(-1) { |n| }
  *
- *  Raises an exception if the single argument is neither \Array-convertible
- *  nor \Integer-convertible.
- *
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    Array.new(:foo)
+ *  Raises an exception if the single argument is neither an \Array nor an \Integer.
  */
 
 static VALUE
@@ -1346,9 +1332,7 @@ rb_ary_pop(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1332
  *  - #shift:  Removes and returns leading elements.
  *  - #unshift:  Prepends leading elements.
  *
- *  Argument +n+, if given, must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects]
- *  (implements +to_int+).
+ *  Argument +n+, if given, must be an \Integer.
  *
  *  ---
  *
@@ -1392,12 +1376,6 @@ rb_ary_pop(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1376
  *    a = [:foo, 'bar', 2]
  *    # Raises ArgumentError (negative array size):
  *    a1 = a.pop(-1)
- *
- *  Raises an exception if +n+ is not \Integer-convertible (implements +to_int+):
- *
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of String into Integer):
- *    a1 = a.pop('x')
  */
 
 static VALUE
@@ -1462,8 +1440,7 @@ rb_ary_shift(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1440
  *  - #pop:  Removes and returns trailing elements.
  *  - #unshift:  Prepends leading elements.
  *
- *  Argument +n+, if given, must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects]
+ *  Argument +n+, if given, must be an \Integer.
  *
  *  ---
  *
@@ -1500,12 +1477,6 @@ rb_ary_shift(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1477
  *    a = [:foo, 'bar', 2]
  *    # Raises ArgumentError (negative array size):
  *    a1 = a.shift(-1)
- *
- *  Raises an exception if +n+ is not an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects]:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a.shift(:foo)
  */
 
 static VALUE
@@ -1748,8 +1719,7 @@ static VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e); https://github.com/ruby/ruby/blob/trunk/array.c#L1719
  *
  *  Returns elements from +self+; does not modify +self+.
  *
- *  - Arguments +index+, +start+, and +length+, if given, must be
- *    {Integer-convertible objects}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects].
+ *  - Arguments +index+, +start+, and +length+, if given, must be Integers.
  *  - Argument +range+, if given, must be a \Range object.
  *
  *  ---
@@ -1830,21 +1800,6 @@ static VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e); https://github.com/ruby/ruby/blob/trunk/array.c#L1800
  *    a[4..1] # => nil
  *    a[4..0] # => nil
  *    a[4..-1] # => nil
- *
- *  ---
- *
- *  Raises an exception if given a single argument
- *  that is not an \Integer-convertible object or a \Range object:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a[:foo]
- *
- *  Raises an exception if given two arguments that are not both \Integer-convertible objects:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a[:foo, 3]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a[1, :bar]
  */
 
 VALUE
@@ -1893,20 +1848,12 @@ rb_ary_aref1(VALUE ary, VALUE arg) https://github.com/ruby/ruby/blob/trunk/array.c#L1848
  *  call-seq:
  *    array.at(index) -> object
  *
- *  Argument +index+ must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects].
+ *  Argument +index+ must be an \Integer.
  *
  *  Returns the element at offset +index+; does not modify +self+.
  *    a = [:foo, 'bar', 2]
  *    a.at(0) # => :foo
  *    a.at(2) # => 2
- *
- *  ---
- *
- *  Raises an exception if +index+ is not an \Integer-convertible object:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a.at(:foo)
  */
 
 VALUE
@@ -1923,8 +1870,7 @@ rb_ary_at(VALUE ary, VALUE pos) https://github.com/ruby/ruby/blob/trunk/array.c#L1870
  *  Returns elements from +self+; does not modify +self+.
  *  See also #last.
  *
- *  Argument +n+, if given, must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects].
+ *  Argument +n+, if given, must be an \Integer.
  *
  *  ---
  *
@@ -1956,11 +1902,6 @@ rb_ary_at(VALUE ary, VALUE pos) https://github.com/ruby/ruby/blob/trunk/array.c#L1902
  *    a = [:foo, 'bar', 2]
  *    # Raises ArgumentError (negative array size):
  *    a.first(-1)
- *
- *  Raises an exception if +n+ is not an \Integer-convertible object:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of String into Integer):
- *    a.first(:X)
  */
 static VALUE
 rb_ary_first(int argc, VALUE *argv, VALUE ary)
@@ -1982,8 +1923,7 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1923
  *  Returns elements from +self+; +self+ is not modified.
  *  See also #first.
  *
- *  Argument +n+, if given, must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects].
+ *  Argument +n+, if given, must be an \Integer.
  *
  *  ---
  *
@@ -2015,11 +1955,6 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1955
  *    a = [:foo, 'bar', 2]
  *    # Raises ArgumentError (negative array size):
  *    a.last(-1)
- *
- *  Raises an exception if +n+ is not an \Integer-convertible object:
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a.last(:X)
  */
 
 VALUE
@@ -2043,8 +1978,7 @@ rb_ary_last(int argc, const VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L1978
  *
  *  Returns the element at offset  +index+.
  *
- *  Argument +index+ must be an
- *  {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects]
+ *  Argument +index+ must be an \Integer.
  *
  *  ---
  *
@@ -2078,11 +2012,6 @@ rb_ary_last(int argc, const VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2012
  *
  *  ---
  *
- *  Raises an exception if +index+ is not an \Integer-convertible object.
- *    a = [:foo, 'bar', 2]
- *    # Raises TypeError (no implicit conversion of Symbol into Integer):
- *    a.fetch(:foo)
- *
  *  Raises an exception if +index+ is out of range and neither default_value nor a block given:
  *    a = [:foo, 'bar', 2]
  *    # Raises IndexError (index 50 outside of array bounds: -3...3):
@@ -2446,12 +2375,8 @@ ary_aset_by_rb_ary_splice(VALUE ary, long beg, long len, VALUE val) https://github.com/ruby/ruby/blob/trunk/array.c#L2375
  *
  *  Assigns elements in +self+; returns the given +object+.
  *
- *  - Arguments +index+, +start+, and +length+, if given, must be
- *    {Integer-convertible objects}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects].
+ *  - Arguments +index+, +start+, and +length+, if given, must be Integers.
  *  - Argument +range+, if given, must be a \Range object.
- *  - If +object+ is an
- *    {Array-convertible object}[doc/implicit_conversion_rdoc.html#label-Array-Convertible+Objects]
- *    it will be converted to an \Array.
  *
  *  ---
  *
@@ -2474,7 +2399,7 @@ ary_aset_by_rb_ary_splice(VALUE ary, long beg, long len, VALUE val) https://github.com/ruby/ruby/blob/trunk/array.c#L2399
  *
  *  ---
  *
- *  When +start+ and +length+ are given and +object+ is not an Array-convertible object,
+ *  When +start+ and +length+ are given and +object+ is not an Array,
  *  removes <tt>length - 1</tt> elements beginning at offset +start+,
  *  and assigns +object+ at offset +sta (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]