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

ruby-changes:71156

From: Nobuyoshi <ko1@a...>
Date: Sat, 12 Feb 2022 12:45:27 +0900 (JST)
Subject: [ruby-changes:71156] 50c972a1ae (master): [DOC] Simplify operator method references

https://git.ruby-lang.org/ruby.git/commit/?id=50c972a1ae

From 50c972a1ae1b15b292f45e78ff3227644f3cabda Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 11 Feb 2022 10:30:28 +0900
Subject: [DOC] Simplify operator method references

---
 array.c   | 17 +++++++++--------
 compar.c  | 12 +++++-------
 hash.c    | 10 +++++-----
 io.c      |  2 +-
 numeric.c | 54 ++++++++++++++++++++++++++----------------------------
 object.c  | 32 ++++++++++++++------------------
 range.c   |  5 ++---
 string.c  | 22 ++++++++++++----------
 struct.c  |  4 ++--
 timev.rb  |  5 ++---
 10 files changed, 78 insertions(+), 85 deletions(-)

diff --git a/array.c b/array.c
index e9e1773179..82d374d0ba 100644
--- a/array.c
+++ b/array.c
@@ -5001,7 +5001,7 @@ recursive_eql(VALUE ary1, VALUE ary2, int recur) https://github.com/ruby/ruby/blob/trunk/array.c#L5001
  *
  *  Otherwise, returns +false+.
  *
- *  This method is different from method {Array#==}[#method-i-3D-3D],
+ *  This method is different from method Array#==,
  *  which compares using method <tt>Object#==</tt>.
  */
 
@@ -8119,10 +8119,11 @@ rb_ary_deconstruct(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L8119
  *  #hash:: Returns the integer hash code.
  *
  *  === Methods for Comparing
- *  {#<=>}[#method-i-3C-3D-3E]:: Returns -1, 0, or 1
- *                               as +self+ is less than, equal to, or greater than a given object.
- *  {#==}[#method-i-3D-3D]:: Returns whether each element in +self+ is <tt>==</tt> to the
- *                           corresponding element in a given object.
+
+ *  #<=>:: Returns -1, 0, or 1 as +self+ is less than, equal to, or greater than a given
+ *         object.
+ *  #==:: Returns whether each element in +self+ is <tt>==</tt> to the corresponding element
+ *        in a given object.
  *  #eql?:: Returns whether each element in +self+ is <tt>eql?</tt> to the corresponding
  *          element in a given object.
 
@@ -8202,13 +8203,13 @@ rb_ary_deconstruct(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L8203
  *
  *  === Methods for Combining
  *
- *  {#&}[#method-i-26]:: Returns an array containing elements found both in +self+ and a given array.
+ *  #&:: Returns an array containing elements found both in +self+ and a given array.
  *  #intersection:: Returns an array containing elements found both in +self+
  *                  and in each given array.
  *  #+:: Returns an array containing all elements of +self+ followed by all elements of a given array.
  *  #-:: Returns an array containiing all elements of +self+ that are not found in a given array.
- *  {#|}[#method-i-7C]:: Returns an array containing all elements of +self+ and all elements of a given array,
- *                       duplicates removed.
+ *  #|:: Returns an array containing all elements of +self+ and all elements of a given array,
+ *       duplicates removed.
  *  #union:: Returns an array containing all elements of +self+ and all elements of given arrays,
  *           duplicates removed.
  *  #difference:: Returns an array containing all elements of +self+ that are not found
diff --git a/compar.c b/compar.c
index e9d1ac41f9..c82d44c103 100644
--- a/compar.c
+++ b/compar.c
@@ -288,13 +288,11 @@ cmp_clamp(int argc, VALUE *argv, VALUE x) https://github.com/ruby/ruby/blob/trunk/compar.c#L288
  *
  *  \Module \Comparable provides these methods, all of which use method <tt><=></tt>:
  *
- *  - {<}[#method-i-3C]:: Returns whether +self+ is less than the given object.
- *  - {<=}[#method-i-3C-3D]:: Returns whether +self+ is less than or equal to
- *                            the given object.
- *  - {==}[#method-i-3D-3D]:: Returns whether +self+ is equal to the given object.
- *  - {>}[#method-i-3E]:: Returns whether +self+ is greater than or equal to
- *                        the given object.
- *  - {>=}[#method-i-3E-3D]:: Returns whether +self+ is greater than the given object.
+ *  - #<:: Returns whether +self+ is less than the given object.
+ *  - #<=:: Returns whether +self+ is less than or equal to the given object.
+ *  - #==:: Returns whether +self+ is equal to the given object.
+ *  - #>:: Returns whether +self+ is greater than or equal to the given object.
+ *  - #>=:: Returns whether +self+ is greater than the given object.
  *  - #between? Returns +true+ if +self+ is between two given objects.
  *  - #clamp:: For given objects +min+ and +max+, or range <tt>(min..max)</tt>, returns:
  *    - +min+ if <tt>(self <=> min) < 0</tt>.
diff --git a/hash.c b/hash.c
index ad8ce23e2e..630117ae8a 100644
--- a/hash.c
+++ b/hash.c
@@ -7063,11 +7063,11 @@ static const rb_data_type_t env_data_type = { https://github.com/ruby/ruby/blob/trunk/hash.c#L7063
  *
  *  ==== Methods for Comparing
  *
- *  {#<}[#method-i-3C]:: Returns whether +self+ is a proper subset of a given object.
- *  {#<=}[#method-i-3C-3D]:: Returns whether +self+ is a subset of a given object.
- *  {#==}[#method-i-3D-3D]:: Returns whether a given object is equal to +self+.
- *  {#>}[#method-i-3E]:: Returns whether +self+ is a proper superset of a given object
- *  {#>=}[#method-i-3E-3D]:: Returns whether +self+ is a proper superset of a given object.
+ *  #<:: Returns whether +self+ is a proper subset of a given object.
+ *  #<=:: Returns whether +self+ is a subset of a given object.
+ *  #==:: Returns whether a given object is equal to +self+.
+ *  #>:: Returns whether +self+ is a proper superset of a given object
+ *  #>=:: Returns whether +self+ is a proper superset of a given object.
  *
  *  ==== Methods for Fetching
  *
diff --git a/io.c b/io.c
index 2acecb550b..88897960ab 100644
--- a/io.c
+++ b/io.c
@@ -14432,7 +14432,7 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y) https://github.com/ruby/ruby/blob/trunk/io.c#L14432
  *  - ::binwrite:: Writes the given string to the file at the given filepath,
  *                 in binary mode.
  *  - ::write:: Writes the given string to +self+.
- *  - {::<<}[#method-i-3C-3C]:: Appends the given string to +self+.
+ *  - ::<<:: Appends the given string to +self+.
  *  - #print:: Prints last read line or given objects to +self+.
  *  - #printf:: Writes to +self+ based on the given format string and objects.
  *  - #putc:: Writes a character to +self+.
diff --git a/numeric.c b/numeric.c
index b2f41a3f86..61f93c4f01 100644
--- a/numeric.c
+++ b/numeric.c
@@ -975,25 +975,24 @@ num_negative_p(VALUE num) https://github.com/ruby/ruby/blob/trunk/numeric.c#L975
  *
  *  === Comparing
  *
- *  - {<}[#method-i-3C]:: Returns whether +self+ is less than the given value.
- *  - {<=}[#method-i-3C-3D]:: Returns whether +self+ is less than
- *                            or equal to the given value.
- *  - {<=>}[#method-i-3C-3D-3E]:: Returns a number indicating whether +self+ is less than,
- *                                equal to, or greater than the given value.
- *  - {==}[#method-i-3D-3D] (aliased as #=== and #eql>):: Returns whether +self+ is
- *                                                        equal to the given value.
- *  - {>}[#method-i-3E]:: Returns whether +self+ is greater than the given value.
- *  - {>=}[#method-i-3E-3D]:: Returns whether +self+ is greater than
- *                            or equal to the given value.
+ *  - #<:: Returns whether +self+ is less than the given value.
+ *  - #<=:: Returns whether +self+ is less than or equal to the given value.
+ *  - #<=>:: Returns a number indicating whether +self+ is less than, equal
+ *           to, or greater than the given value.
+ *  - #== (aliased as #=== and #eql?):: Returns whether +self+ is equal to
+ *                                      the given value.
+ *  - #>:: Returns whether +self+ is greater than the given value.
+ *  - #>=:: Returns whether +self+ is greater than or equal to the given
+ *          value.
  *
  *  === Converting
  *
  *  - #% (aliased as #modulo):: Returns +self+ modulo the given value.
  *  - #*:: Returns the product of +self+ and the given value.
- *  - {**}[#method-i-2A-2A]:: Returns the value of +self+ raised to the power of the given value.
+ *  - #**:: Returns the value of +self+ raised to the power of the given value.
  *  - #+:: Returns the sum of +self+ and the given value.
  *  - #-:: Returns the difference of +self+ and the given value.
- *  - {/}[#method-i-2F]:: Returns the quotient of +self+ and the given value.
+ *  - #/:: Returns the quotient of +self+ and the given value.
  *  - #ceil:: Returns the smallest number greater than or equal to +self+.
  *  - #coerce:: Returns a 2-element array containing the given value converted to a \Float
                 and +self+
@@ -3512,32 +3511,31 @@ rb_num2ull(VALUE val) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3511
  *
  * === Comparing
  *
- * - {<}[#method-i-3C]:: Returns whether +self+ is less than the given value.
- * - {<=}[#method-i-3C-3D]:: Returns whether +self+ is less than
- *                           or equal to the given value.
- * - {<=>}[#method-i-3C-3D-3E]:: Returns a number indicating whether +self+ is less than,
- *                               equal to, or greater than the given value.
- * - {==}[#method-i-3D-3D] (aliased as #===):: Returns whether +self+ is
- *                                             equal to the given value.
- * - {>}[#method-i-3E]:: Returns whether +self+ is greater than the given value.
- * - {>=}[#method-i-3E-3D]:: Returns whether +self+ is greater than
- *                           or equal to the given value.
+ * - #<:: Returns whether +self+ is less than the given value.
+ * - #<=:: Returns whether +self+ is less than or equal to the given value.
+ * - #<=>:: Returns a number indicating whether +self+ is less than, equal
+ *          to, or greater than the given value.
+ * - #== (aliased as #===):: Returns whether +self+ is equal to the given
+ *                           value.
+ * - #>:: Returns whether +self+ is greater than the given value.
+ * - #>=:: Returns whether +self+ is greater than or equal to the given
+ *         value.
  *
  * === Co (... truncated)

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

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