summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-complex/mrblib/complex.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-05-18 18:57:47 +0900
committerGitHub <[email protected]>2019-05-18 18:57:47 +0900
commit1cdb3ec93c09629dd24cab8a5e8f66ae6d26bf60 (patch)
tree7c65c56fe44b08e8346615b0ff6a72648006126b /mrbgems/mruby-complex/mrblib/complex.rb
parented70e81264df4ce0650abfe86e72148aa7d422ba (diff)
parent6c9c189e4b9b5a340e220b333bc5f975fdb65adc (diff)
downloadmruby-1cdb3ec93c09629dd24cab8a5e8f66ae6d26bf60.tar.gz
mruby-1cdb3ec93c09629dd24cab8a5e8f66ae6d26bf60.zip
Merge pull request #4448 from shuujii/move-Object-Rational-Complex-to-Kernel
Move `Object#(Rational|Complex)` to `Kernel`
Diffstat (limited to 'mrbgems/mruby-complex/mrblib/complex.rb')
-rw-r--r--mrbgems/mruby-complex/mrblib/complex.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/mrbgems/mruby-complex/mrblib/complex.rb b/mrbgems/mruby-complex/mrblib/complex.rb
index 266c00c36..8ae743e77 100644
--- a/mrbgems/mruby-complex/mrblib/complex.rb
+++ b/mrbgems/mruby-complex/mrblib/complex.rb
@@ -107,7 +107,7 @@ class Complex < Numeric
def polar
[abs, arg]
end
-
+
def real?
false
end
@@ -147,8 +147,10 @@ class << Complex
alias_method :rect, :rectangular
end
-def Complex(real, imaginary = 0)
- Complex.rectangular(real, imaginary)
+module Kernel
+ def Complex(real, imaginary = 0)
+ Complex.rectangular(real, imaginary)
+ end
end
[Fixnum, Float].each do |cls|
@@ -165,4 +167,4 @@ end
end
end
end
-end \ No newline at end of file
+end