Move `Object#(Rational|Complex)` to `Kernel`
MODIFY
mrbgems/mruby-complex/mrblib/complex.rb
mrbgems/mruby-complex/mrblib/complex.rb
@@ -147,9 +147,11 @@ class << Complex
alias_method :rect, :rectangular
end
+module Kernel
def Complex(real, imaginary = 0)
Complex.rectangular(real, imaginary)
end
+end
[Fixnum, Float].each do |cls|
[:+, :-, :*, :/, :==].each do |op|

MODIFY
mrbgems/mruby-rational/mrblib/rational.rb
mrbgems/mruby-rational/mrblib/rational.rb
@@ -75,12 +75,14 @@ class Numeric
end
end
+module Kernel
def Rational(numerator = 0, denominator = 1)
a = numerator
b = denominator
a, b = b, a % b until b == 0
Rational._new(numerator.div(a), denominator.div(a))
end
+end
[:+, :-, :*, :/, :<=>, :==, :<, :<=, :>, :>=].each do |op|
Fixnum.instance_exec do

Move `Object#(Rational|Complex)` to `Kernel`