Skip to content

Commit a314142

Browse files
authored
Merge pull request #2620 from ksss/imaginary
Remove undocumented methods for `imaginary`
2 parents 5b9f16d + 94abfb0 commit a314142

File tree

5 files changed

+18
-23
lines changed

5 files changed

+18
-23
lines changed

core/complex.rbs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,19 @@ class Complex < Numeric
448448
#
449449
def hash: () -> Integer
450450

451+
# <!--
452+
# rdoc-file=numeric.c
453+
# - i -> complex
454+
# -->
455+
# Returns `Complex(0, self)`:
456+
#
457+
# 2.i # => (0+2i)
458+
# -2.i # => (0-2i)
459+
# 2.0.i # => (0+2.0i)
460+
# Rational(1, 2).i # => (0+(1/2)*i)
461+
# Complex(3, 4).i # Raises NoMethodError.
462+
#
463+
%a{annotate:rdoc:copy:Numeric#i}
451464
def i: () -> bot
452465

453466
# <!-- rdoc-file=complex.c -->

core/float.rbs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,6 @@ class Float < Numeric
582582
#
583583
def hash: () -> Integer
584584

585-
def i: () -> Complex
586-
587-
def imag: () -> Integer
588-
589-
def imaginary: () -> Integer
590-
591585
# <!--
592586
# rdoc-file=numeric.c
593587
# - infinite? -> -1, 1, or nil

core/integer.rbs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,12 +895,6 @@ class Integer < Numeric
895895
#
896896
def gcdlcm: (Integer) -> [ Integer, Integer ]
897897

898-
def i: () -> Complex
899-
900-
def imag: () -> Integer
901-
902-
def imaginary: () -> Integer
903-
904898
def infinite?: () -> Integer?
905899

906900
# <!-- rdoc-file=numeric.c -->

core/numeric.rbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,18 +445,18 @@ class Numeric
445445

446446
# <!--
447447
# rdoc-file=numeric.rb
448-
# - imag()
448+
# - imag -> 0
449449
# -->
450+
# Returns zero.
450451
#
451-
def imag: () -> Numeric
452+
def imaginary: () -> 0
452453

453454
# <!--
454455
# rdoc-file=numeric.rb
455-
# - imag -> 0
456+
# - imag()
456457
# -->
457-
# Returns zero.
458458
#
459-
def imaginary: () -> Numeric
459+
alias imag imaginary
460460

461461
# <!--
462462
# rdoc-file=numeric.rb

core/rational.rbs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,6 @@ class Rational < Numeric
289289
#
290290
def hash: () -> Integer
291291

292-
def i: () -> Complex
293-
294-
def imag: () -> Integer
295-
296-
def imaginary: () -> Integer
297-
298292
def infinite?: () -> Integer?
299293

300294
# <!--

0 commit comments

Comments
 (0)