rbs 3.0.0.dev.2 → 3.0.0.dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +2 -1
  3. data/.github/workflows/ruby.yml +4 -0
  4. data/Gemfile.lock +11 -11
  5. data/Rakefile +2 -2
  6. data/Steepfile +1 -1
  7. data/core/array.rbs +573 -423
  8. data/core/basic_object.rbs +11 -39
  9. data/core/binding.rbs +1 -1
  10. data/core/builtin.rbs +8 -0
  11. data/core/class.rbs +37 -0
  12. data/core/comparable.rbs +7 -18
  13. data/core/complex.rbs +2 -2
  14. data/core/data.rbs +419 -0
  15. data/core/dir.rbs +52 -104
  16. data/core/encoding.rbs +22 -181
  17. data/core/enumerable.rbs +212 -175
  18. data/core/enumerator/product.rbs +96 -0
  19. data/core/enumerator.rbs +57 -8
  20. data/core/errors.rbs +8 -2
  21. data/core/exception.rbs +41 -0
  22. data/core/fiber.rbs +95 -12
  23. data/core/file.rbs +840 -275
  24. data/core/file_test.rbs +34 -19
  25. data/core/float.rbs +40 -96
  26. data/core/gc.rbs +15 -3
  27. data/core/hash.rbs +113 -175
  28. data/core/integer.rbs +85 -145
  29. data/core/io/buffer.rbs +187 -60
  30. data/core/io/wait.rbs +28 -16
  31. data/core/io.rbs +1859 -1389
  32. data/core/kernel.rbs +525 -961
  33. data/core/match_data.rbs +306 -142
  34. data/core/math.rbs +506 -234
  35. data/core/method.rbs +0 -24
  36. data/core/module.rbs +110 -17
  37. data/core/nil_class.rbs +2 -0
  38. data/core/numeric.rbs +76 -144
  39. data/core/object.rbs +88 -212
  40. data/core/proc.rbs +17 -5
  41. data/core/process.rbs +22 -5
  42. data/core/ractor.rbs +1 -1
  43. data/core/random.rbs +20 -3
  44. data/core/range.rbs +91 -89
  45. data/core/rational.rbs +2 -3
  46. data/core/rbs/unnamed/argf.rbs +177 -120
  47. data/core/rbs/unnamed/env_class.rbs +89 -163
  48. data/core/rbs/unnamed/random.rbs +36 -12
  49. data/core/refinement.rbs +8 -0
  50. data/core/regexp.rbs +462 -272
  51. data/core/ruby_vm.rbs +210 -0
  52. data/{stdlib/set/0 → core}/set.rbs +43 -47
  53. data/core/string.rbs +1403 -1332
  54. data/core/string_io.rbs +191 -107
  55. data/core/struct.rbs +67 -63
  56. data/core/symbol.rbs +187 -201
  57. data/core/thread.rbs +40 -35
  58. data/core/time.rbs +902 -826
  59. data/core/trace_point.rbs +55 -6
  60. data/core/unbound_method.rbs +48 -24
  61. data/docs/collection.md +4 -0
  62. data/docs/syntax.md +55 -0
  63. data/ext/rbs_extension/parser.c +5 -6
  64. data/lib/rbs/cli.rb +6 -1
  65. data/lib/rbs/collection/cleaner.rb +8 -1
  66. data/lib/rbs/collection/config/lockfile.rb +3 -1
  67. data/lib/rbs/collection/config/lockfile_generator.rb +16 -14
  68. data/lib/rbs/collection/config.rb +1 -1
  69. data/lib/rbs/collection/sources/git.rb +9 -2
  70. data/lib/rbs/collection/sources/local.rb +79 -0
  71. data/lib/rbs/collection/sources.rb +8 -1
  72. data/lib/rbs/environment.rb +6 -5
  73. data/lib/rbs/environment_loader.rb +3 -2
  74. data/lib/rbs/errors.rb +18 -0
  75. data/lib/rbs/locator.rb +26 -7
  76. data/lib/rbs/sorter.rb +2 -2
  77. data/lib/rbs/version.rb +1 -1
  78. data/sig/collection/sources.rbs +32 -3
  79. data/sig/environment.rbs +2 -3
  80. data/sig/locator.rbs +14 -2
  81. data/sig/shims/{abstract_syntax_tree.rbs → _abstract_syntax_tree.rbs} +0 -0
  82. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -13
  83. data/stdlib/cgi/0/core.rbs +16 -0
  84. data/stdlib/coverage/0/coverage.rbs +50 -8
  85. data/stdlib/csv/0/csv.rbs +1 -1
  86. data/stdlib/date/0/date.rbs +856 -726
  87. data/stdlib/date/0/date_time.rbs +83 -210
  88. data/stdlib/erb/0/erb.rbs +13 -36
  89. data/stdlib/etc/0/etc.rbs +127 -20
  90. data/stdlib/fileutils/0/fileutils.rbs +1290 -381
  91. data/stdlib/logger/0/logger.rbs +466 -316
  92. data/stdlib/net-http/0/net-http.rbs +2211 -534
  93. data/stdlib/nkf/0/nkf.rbs +5 -5
  94. data/stdlib/objspace/0/objspace.rbs +31 -14
  95. data/stdlib/openssl/0/openssl.rbs +11 -7
  96. data/stdlib/optparse/0/optparse.rbs +20 -17
  97. data/stdlib/pathname/0/pathname.rbs +21 -4
  98. data/stdlib/pstore/0/pstore.rbs +378 -154
  99. data/stdlib/pty/0/pty.rbs +24 -8
  100. data/stdlib/ripper/0/ripper.rbs +1650 -0
  101. data/stdlib/socket/0/addrinfo.rbs +9 -15
  102. data/stdlib/socket/0/socket.rbs +36 -3
  103. data/stdlib/strscan/0/string_scanner.rbs +7 -5
  104. data/stdlib/tempfile/0/tempfile.rbs +104 -44
  105. data/stdlib/time/0/time.rbs +2 -2
  106. data/stdlib/uri/0/file.rbs +5 -0
  107. data/stdlib/uri/0/generic.rbs +2 -2
  108. data/stdlib/yaml/0/yaml.rbs +2 -2
  109. data/stdlib/zlib/0/zlib.rbs +1 -1
  110. metadata +8 -6
  111. data/core/deprecated.rbs +0 -9
  112. data/sig/shims/ripper.rbs +0 -8
data/core/method.rbs CHANGED
@@ -254,30 +254,6 @@ class Method < Object
254
254
  #
255
255
  def parameters: () -> ::Array[[ :req | :opt | :rest | :keyreq | :key | :keyrest | :block, Symbol ] | [ :rest | :keyrest ]]
256
256
 
257
- # <!--
258
- # rdoc-file=proc.c
259
- # - meth.private? -> true or false
260
- # -->
261
- # Returns whether the method is private.
262
- #
263
- def private?: () -> bool
264
-
265
- # <!--
266
- # rdoc-file=proc.c
267
- # - meth.protected? -> true or false
268
- # -->
269
- # Returns whether the method is protected.
270
- #
271
- def protected?: () -> bool
272
-
273
- # <!--
274
- # rdoc-file=proc.c
275
- # - meth.public? -> true or false
276
- # -->
277
- # Returns whether the method is public.
278
- #
279
- def public?: () -> bool
280
-
281
257
  # <!--
282
258
  # rdoc-file=proc.c
283
259
  # - meth.receiver -> object
data/core/module.rbs CHANGED
@@ -85,13 +85,41 @@ class Module < Object
85
85
  #
86
86
  def self.used_modules: () -> ::Array[Module]
87
87
 
88
+ # <!--
89
+ # rdoc-file=eval.c
90
+ # - used_refinements -> array
91
+ # -->
92
+ # Returns an array of all modules used in the current scope. The ordering of
93
+ # modules in the resulting array is not defined.
94
+ #
95
+ # module A
96
+ # refine Object do
97
+ # end
98
+ # end
99
+ #
100
+ # module B
101
+ # refine Object do
102
+ # end
103
+ # end
104
+ #
105
+ # using A
106
+ # using B
107
+ # p Module.used_refinements
108
+ #
109
+ # *produces:*
110
+ #
111
+ # [#<refinement:Object@B>, #<refinement:Object@A>]
112
+ #
113
+ def self.used_refinements: () -> Array[Refinement]
114
+
88
115
  # <!--
89
116
  # rdoc-file=object.c
90
117
  # - mod < other -> true, false, or nil
91
118
  # -->
92
- # Returns true if *mod* is a subclass of *other*. Returns `nil` if there's no
93
- # relationship between the two. (Think of the relationship in terms of the class
94
- # definition: "class A < B" implies "A < B".)
119
+ # Returns true if *mod* is a subclass of *other*. Returns `false` if *mod* is
120
+ # the same as *other* or *mod* is an ancestor of *other*. Returns `nil` if
121
+ # there's no relationship between the two. (Think of the relationship in terms
122
+ # of the class definition: "class A < B" implies "A < B".)
95
123
  #
96
124
  def <: (Module other) -> bool?
97
125
 
@@ -169,9 +197,10 @@ class Module < Object
169
197
  # rdoc-file=object.c
170
198
  # - mod > other -> true, false, or nil
171
199
  # -->
172
- # Returns true if *mod* is an ancestor of *other*. Returns `nil` if there's no
173
- # relationship between the two. (Think of the relationship in terms of the class
174
- # definition: "class A < B" implies "B > A".)
200
+ # Returns true if *mod* is an ancestor of *other*. Returns `false` if *mod* is
201
+ # the same as *other* or *mod* is a descendant of *other*. Returns `nil` if
202
+ # there's no relationship between the two. (Think of the relationship in terms
203
+ # of the class definition: "class A < B" implies "B > A".)
175
204
  #
176
205
  def >: (Module other) -> bool?
177
206
 
@@ -255,7 +284,7 @@ class Module < Object
255
284
  # end
256
285
  # Mod.instance_methods.sort #=> [:one, :one=, :two, :two=]
257
286
  #
258
- def attr_accessor: (*Symbol | String arg0) -> NilClass
287
+ def attr_accessor: (*Symbol | String arg0) -> Array[Symbol]
259
288
 
260
289
  # <!--
261
290
  # rdoc-file=object.c
@@ -269,7 +298,7 @@ class Module < Object
269
298
  # in turn. String arguments are converted to symbols. Returns an array of
270
299
  # defined method names as symbols.
271
300
  #
272
- def attr_reader: (*Symbol | String arg0) -> NilClass
301
+ def attr_reader: (*Symbol | String arg0) -> Array[Symbol]
273
302
 
274
303
  # <!--
275
304
  # rdoc-file=object.c
@@ -280,20 +309,24 @@ class Module < Object
280
309
  # *symbol*`.id2name`. String arguments are converted to symbols. Returns an
281
310
  # array of defined method names as symbols.
282
311
  #
283
- def attr_writer: (*Symbol | String arg0) -> NilClass
312
+ def attr_writer: (*Symbol | String arg0) -> Array[Symbol]
284
313
 
285
314
  # <!--
286
315
  # rdoc-file=load.c
287
- # - mod.autoload(module, filename) -> nil
316
+ # - mod.autoload(const, filename) -> nil
288
317
  # -->
289
- # Registers *filename* to be loaded (using Kernel::require) the first time that
290
- # *module* (which may be a String or a symbol) is accessed in the namespace of
291
- # *mod*.
318
+ # Registers _filename_ to be loaded (using Kernel::require)
319
+ # the first time that _const_ (which may be a String or
320
+ # a symbol) is accessed in the namespace of _mod_.
292
321
  #
293
- # module A
294
- # end
295
- # A.autoload(:B, "b")
296
- # A::B.doit # autoloads "b"
322
+ # module A
323
+ # end
324
+ # A.autoload(:B, "b")
325
+ # A::B.doit # autoloads "b"
326
+ #
327
+ # If *const* in *mod* is defined as autoload, the file name to be loaded is
328
+ # replaced with *filename*. If *const* is defined but not as autoload, does
329
+ # nothing.
297
330
  #
298
331
  def autoload: (Symbol _module, String filename) -> NilClass
299
332
 
@@ -436,6 +469,26 @@ class Module < Object
436
469
  #
437
470
  def class_variables: (?boolish inherit) -> ::Array[Symbol]
438
471
 
472
+ # <!--
473
+ # rdoc-file=object.c
474
+ # - const_added(const_name)
475
+ # -->
476
+ # Invoked as a callback whenever a constant is assigned on the receiver
477
+ #
478
+ # module Chatty
479
+ # def self.const_added(const_name)
480
+ # super
481
+ # puts "Added #{const_name.inspect}"
482
+ # end
483
+ # FOO = 1
484
+ # end
485
+ #
486
+ # *produces:*
487
+ #
488
+ # Added :FOO
489
+ #
490
+ def const_added: (Symbol) -> void
491
+
439
492
  # <!--
440
493
  # rdoc-file=object.c
441
494
  # - mod.const_defined?(sym, inherit=true) -> true or false
@@ -911,6 +964,15 @@ class Module < Object
911
964
  # C.instance_methods(false) #=> [:method3]
912
965
  # C.instance_methods.include?(:method2) #=> true
913
966
  #
967
+ # Note that method visibility changes in the current class, as well as aliases,
968
+ # are considered as methods of the current class by this method:
969
+ #
970
+ # class C < B
971
+ # alias method4 method2
972
+ # protected :method2
973
+ # end
974
+ # C.instance_methods(false).sort #=> [:method2, :method3, :method4]
975
+ #
914
976
  def instance_methods: (?boolish include_super) -> ::Array[Symbol]
915
977
 
916
978
  # <!--
@@ -1403,6 +1465,28 @@ class Module < Object
1403
1465
  #
1404
1466
  def refine: (Module mod) { () -> void } -> Refinement
1405
1467
 
1468
+ # <!--
1469
+ # rdoc-file=eval.c
1470
+ # - refinements -> array
1471
+ # -->
1472
+ # Returns an array of modules defined within the receiver.
1473
+ #
1474
+ # module A
1475
+ # refine Integer do
1476
+ # end
1477
+ #
1478
+ # refine String do
1479
+ # end
1480
+ # end
1481
+ #
1482
+ # p A.refinements
1483
+ #
1484
+ # *produces:*
1485
+ #
1486
+ # [#<refinement:Integer@A>, #<refinement:String@A>]
1487
+ #
1488
+ def refinements: () -> Array[Refinement]
1489
+
1406
1490
  # <!--
1407
1491
  # rdoc-file=object.c
1408
1492
  # - remove_class_variable(sym) -> obj
@@ -1509,6 +1593,15 @@ class Module < Object
1509
1593
  #
1510
1594
  def undef_method: (*Symbol | String arg0) -> self
1511
1595
 
1596
+ # <!--
1597
+ # rdoc-file=object.c
1598
+ # - mod.undefined_instance_methods -> array
1599
+ # -->
1600
+ # Returns a list of the undefined instance methods defined in *mod*. The
1601
+ # undefined methods of any ancestors are not included.
1602
+ #
1603
+ def undefined_instance_methods: () -> Array[Symbol]
1604
+
1512
1605
  # <!--
1513
1606
  # rdoc-file=eval.c
1514
1607
  # - using(module) -> self
data/core/nil_class.rbs CHANGED
@@ -33,6 +33,8 @@ class NilClass
33
33
  # -->
34
34
  # Dummy pattern matching -- always returns nil.
35
35
  #
36
+ # This method makes it possible to `while gets =~ /re/ do`.
37
+ #
36
38
  def =~: (untyped obj) -> nil
37
39
 
38
40
  # <!--
data/core/numeric.rbs CHANGED
@@ -74,162 +74,90 @@
74
74
  #
75
75
  # First, what's elsewhere. Class Numeric:
76
76
  #
77
- # * Inherits from [class
78
- # Object](Object.html#class-Object-label-What-27s+Here).
79
- # * Includes [module
80
- # Comparable](Comparable.html#module-Comparable-label-What-27s+Here).
77
+ # * Inherits from [class Object](rdoc-ref:Object@What-27s+Here).
78
+ # * Includes [module Comparable](rdoc-ref:Comparable@What-27s+Here).
81
79
  #
82
80
  #
83
81
  # Here, class Numeric provides methods for:
84
82
  #
85
- # * [Querying](#class-Numeric-label-Querying)
86
- # * [Comparing](#class-Numeric-label-Comparing)
87
- # * [Converting](#class-Numeric-label-Converting)
88
- # * [Other](#class-Numeric-label-Other)
83
+ # * [Querying](rdoc-ref:Numeric@Querying)
84
+ # * [Comparing](rdoc-ref:Numeric@Comparing)
85
+ # * [Converting](rdoc-ref:Numeric@Converting)
86
+ # * [Other](rdoc-ref:Numeric@Other)
89
87
  #
90
88
  #
91
89
  # ### Querying
92
90
  #
93
- # #finite?
94
- # : Returns true unless `self` is infinite or not a number.
95
- #
96
- # #infinite?
97
- # : Returns -1, `nil` or +1, depending on whether `self` is
98
- # `-Infinity<tt>, finite, or <tt>+Infinity`.
99
- #
100
- # #integer?
101
- # : Returns whether `self` is an integer.
102
- #
103
- # #negative?
104
- # : Returns whether `self` is negative.
105
- #
106
- # #nonzero?
107
- # : Returns whether `self` is not zero.
108
- #
109
- # #positive?
110
- # : Returns whether `self` is positive.
111
- #
112
- # #real?
113
- # : Returns whether `self` is a real value.
114
- #
115
- # #zero?
116
- # : Returns whether `self` is zero.
117
- #
91
+ # * #finite?: Returns true unless `self` is infinite or not a number.
92
+ # * #infinite?: Returns -1, `nil` or +1, depending on whether `self` is
93
+ # `-Infinity<tt>, finite, or <tt>+Infinity`.
94
+ # * #integer?: Returns whether `self` is an integer.
95
+ # * #negative?: Returns whether `self` is negative.
96
+ # * #nonzero?: Returns whether `self` is not zero.
97
+ # * #positive?: Returns whether `self` is positive.
98
+ # * #real?: Returns whether `self` is a real value.
99
+ # * #zero?: Returns whether `self` is zero.
118
100
  #
119
101
  #
120
102
  # ### Comparing
121
103
  #
122
- # [<=>](#method-i-3C-3D-3E)
123
- # : Returns:
104
+ # * #<=>: Returns:
124
105
  #
125
106
  # * -1 if `self` is less than the given value.
126
107
  # * 0 if `self` is equal to the given value.
127
108
  # * 1 if `self` is greater than the given value.
128
109
  # * `nil` if `self` and the given value are not comparable.
129
110
  #
130
- # #eql?
131
- # : Returns whether `self` and the given value have the same value and
132
- # type.
133
111
  #
112
+ # * #eql?: Returns whether `self` and the given value have the same value and
113
+ # type.
134
114
  #
135
115
  #
136
116
  # ### Converting
137
117
  #
138
- # #% (aliased as #modulo)
139
- # : Returns the remainder of `self` divided by the given value.
140
- #
141
- # #-@
142
- # : Returns the value of `self`, negated.
143
- #
144
- # #abs (aliased as #magnitude)
145
- # : Returns the absolute value of `self`.
146
- #
147
- # #abs2
148
- # : Returns the square of `self`.
149
- #
150
- # #angle (aliased as #arg and #phase)
151
- # : Returns 0 if `self` is positive, Math::PI otherwise.
152
- #
153
- # #ceil
154
- # : Returns the smallest number greater than or equal to `self`, to a
155
- # given precision.
156
- #
157
- # #coerce
158
- # : Returns array `[coerced_self, coerced_other]` for the given other
159
- # value.
160
- #
161
- # #conj (aliased as #conjugate)
162
- # : Returns the complex conjugate of `self`.
163
- #
164
- # #denominator
165
- # : Returns the denominator (always positive) of the Rational
166
- # representation of `self`.
167
- #
168
- # #div
169
- # : Returns the value of `self` divided by the given value and converted
170
- # to an integer.
171
- #
172
- # #divmod
173
- # : Returns array `[quotient, modulus]` resulting from dividing `self` the
174
- # given divisor.
175
- #
176
- # #fdiv
177
- # : Returns the Float result of dividing `self` by the given divisor.
178
- #
179
- # #floor
180
- # : Returns the largest number less than or equal to `self`, to a given
181
- # precision.
182
- #
183
- # #i
184
- # : Returns the Complex object `Complex(0, self)`. the given value.
185
- #
186
- # #imaginary (aliased as #imag)
187
- # : Returns the imaginary part of the `self`.
188
- #
189
- # #numerator
190
- # : Returns the numerator of the Rational representation of `self`; has
191
- # the same sign as `self`.
192
- #
193
- # #polar
194
- # : Returns the array `[self.abs, self.arg]`.
195
- #
196
- # #quo
197
- # : Returns the value of `self` divided by the given value.
198
- #
199
- # #real
200
- # : Returns the real part of `self`.
201
- #
202
- # #rect (aliased as #rectangular)
203
- # : Returns the array `[self, 0]`.
204
- #
205
- # #remainder
206
- # : Returns `self-arg*(self/arg).truncate` for the given `arg`.
207
- #
208
- # #round
209
- # : Returns the value of `self` rounded to the nearest value for the given
210
- # a precision.
211
- #
212
- # #to_c
213
- # : Returns the Complex representation of `self`.
214
- #
215
- # #to_int
216
- # : Returns the Integer representation of `self`, truncating if necessary.
217
- #
218
- # #truncate
219
- # : Returns `self` truncated (toward zero) to a given precision.
220
- #
118
+ # * #% (aliased as #modulo): Returns the remainder of `self` divided by the
119
+ # given value.
120
+ # * #-@: Returns the value of `self`, negated.
121
+ # * #abs (aliased as #magnitude): Returns the absolute value of `self`.
122
+ # * #abs2: Returns the square of `self`.
123
+ # * #angle (aliased as #arg and #phase): Returns 0 if `self` is positive,
124
+ # Math::PI otherwise.
125
+ # * #ceil: Returns the smallest number greater than or equal to `self`, to a
126
+ # given precision.
127
+ # * #coerce: Returns array `[coerced_self, coerced_other]` for the given other
128
+ # value.
129
+ # * #conj (aliased as #conjugate): Returns the complex conjugate of `self`.
130
+ # * #denominator: Returns the denominator (always positive) of the Rational
131
+ # representation of `self`.
132
+ # * #div: Returns the value of `self` divided by the given value and converted
133
+ # to an integer.
134
+ # * #divmod: Returns array `[quotient, modulus]` resulting from dividing
135
+ # `self` the given divisor.
136
+ # * #fdiv: Returns the Float result of dividing `self` by the given divisor.
137
+ # * #floor: Returns the largest number less than or equal to `self`, to a
138
+ # given precision.
139
+ # * #i: Returns the Complex object `Complex(0, self)`. the given value.
140
+ # * #imaginary (aliased as #imag): Returns the imaginary part of the `self`.
141
+ # * #numerator: Returns the numerator of the Rational representation of
142
+ # `self`; has the same sign as `self`.
143
+ # * #polar: Returns the array `[self.abs, self.arg]`.
144
+ # * #quo: Returns the value of `self` divided by the given value.
145
+ # * #real: Returns the real part of `self`.
146
+ # * #rect (aliased as #rectangular): Returns the array `[self, 0]`.
147
+ # * #remainder: Returns `self-arg*(self/arg).truncate` for the given `arg`.
148
+ # * #round: Returns the value of `self` rounded to the nearest value for the
149
+ # given a precision.
150
+ # * #to_c: Returns the Complex representation of `self`.
151
+ # * #to_int: Returns the Integer representation of `self`, truncating if
152
+ # necessary.
153
+ # * #truncate: Returns `self` truncated (toward zero) to a given precision.
221
154
  #
222
155
  #
223
156
  # ### Other
224
157
  #
225
- # #clone
226
- # : Returns `self`; does not allow freezing.
227
- #
228
- # #dup (aliased as #+@)
229
- # : Returns `self`.
230
- #
231
- # #step
232
- # : Invokes the given block with the sequence of specified numbers.
158
+ # * #clone: Returns `self`; does not allow freezing.
159
+ # * #dup (aliased as #+@): Returns `self`.
160
+ # * #step: Invokes the given block with the sequence of specified numbers.
233
161
  #
234
162
  class Numeric
235
163
  include Comparable
@@ -247,9 +175,9 @@ class Numeric
247
175
  #
248
176
  # For Rational `r` and real number `n`, these expressions are equivalent:
249
177
  #
250
- # c % n
251
- # c-n*(c/n).floor
252
- # c.divmod(n)[1]
178
+ # r % n
179
+ # r-n*(r/n).floor
180
+ # r.divmod(n)[1]
253
181
  #
254
182
  # See Numeric#divmod.
255
183
  #
@@ -392,13 +320,15 @@ class Numeric
392
320
  #
393
321
  def coerce: (Numeric) -> [ Numeric, Numeric ]
394
322
 
395
- # <!-- rdoc-file=complex.c -->
396
- # Returns self.
323
+ # <!--
324
+ # rdoc-file=numeric.rb
325
+ # - conj()
326
+ # -->
397
327
  #
398
328
  def conj: () -> Numeric
399
329
 
400
330
  # <!--
401
- # rdoc-file=complex.c
331
+ # rdoc-file=numeric.rb
402
332
  # - num.conj -> self
403
333
  # - num.conjugate -> self
404
334
  # -->
@@ -422,8 +352,8 @@ class Numeric
422
352
  # `/` in the derived class of `self`. (Numeric itself does not define method
423
353
  # `/`.)
424
354
  #
425
- # Of the Core and Standard Library classes, Float, Rational, and Complex use
426
- # this implementation.
355
+ # Of the Core and Standard Library classes, Only Float and Rational use this
356
+ # implementation.
427
357
  #
428
358
  def div: (Numeric) -> Integer
429
359
 
@@ -524,13 +454,15 @@ class Numeric
524
454
  #
525
455
  def i: () -> Complex
526
456
 
527
- # <!-- rdoc-file=complex.c -->
528
- # Returns zero.
457
+ # <!--
458
+ # rdoc-file=numeric.rb
459
+ # - imag()
460
+ # -->
529
461
  #
530
462
  def imag: () -> Numeric
531
463
 
532
464
  # <!--
533
- # rdoc-file=complex.c
465
+ # rdoc-file=numeric.rb
534
466
  # - num.imag -> 0
535
467
  # - num.imaginary -> 0
536
468
  # -->
@@ -577,9 +509,9 @@ class Numeric
577
509
  #
578
510
  # For Rational `r` and real number `n`, these expressions are equivalent:
579
511
  #
580
- # c % n
581
- # c-n*(c/n).floor
582
- # c.divmod(n)[1]
512
+ # r % n
513
+ # r-n*(r/n).floor
514
+ # r.divmod(n)[1]
583
515
  #
584
516
  # See Numeric#divmod.
585
517
  #
@@ -667,7 +599,7 @@ class Numeric
667
599
  def quo: (Numeric) -> Numeric
668
600
 
669
601
  # <!--
670
- # rdoc-file=complex.c
602
+ # rdoc-file=numeric.rb
671
603
  # - num.real -> self
672
604
  # -->
673
605
  # Returns self.