diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-29 14:13:09 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-29 14:13:09 +0000 |
commit | 0001260aaf3b69344b626c4a18faac938682cdbe (patch) | |
tree | be9ebcd740b483ec789db64120bd36e17dd723ca /lib/mathn.rb | |
parent | 79b73a7b31919aec7397d0b5c3f2bbf28a2c9289 (diff) |
moved def_canon.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mathn.rb')
-rw-r--r-- | lib/mathn.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index b8d9f35465..a4a006e2d6 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -35,10 +35,6 @@ class Object private :canon -end - -class Numeric - class << self def def_canon(*ids) @@ -53,6 +49,8 @@ class Numeric end end + private :def_canon + end end @@ -265,27 +263,19 @@ end class NilClass - def to_r() 0 end - def to_c() 0 end + def_canon :to_r, :to_c end class Integer - def to_r() self end - def to_c() self end + def_canon :to_r, :to_c end class String - alias to_r_orig to_r - private :to_r_orig - def to_r() to_r_orig.__send__(:canon) end - - alias to_c_orig to_c - private :to_c_orig - def to_c() to_c_orig.__send__(:canon) end + def_canon :to_r, :to_c end |