diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-05-18 18:31:55 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-05-18 18:31:55 +0900 |
| commit | 6c9c189e4b9b5a340e220b333bc5f975fdb65adc (patch) | |
| tree | 8312354b8581fcd66aae7b2167e9f43af254b0ef /mrbgems/mruby-complex | |
| parent | 89d29264158946a62af8874b4f04e553b0528630 (diff) | |
| download | mruby-6c9c189e4b9b5a340e220b333bc5f975fdb65adc.tar.gz mruby-6c9c189e4b9b5a340e220b333bc5f975fdb65adc.zip | |
Move `Object#(Rational|Complex)` to `Kernel`
Diffstat (limited to 'mrbgems/mruby-complex')
| -rw-r--r-- | mrbgems/mruby-complex/mrblib/complex.rb | 10 |
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 |
