a = Numeric.new # doesn't take an argument
I can't imagine a use case for this. Can you?
The Class
class defines a new
instance method. And so the new
class method on Numeric
is just a holdover from that - it doesn't do anything - think of it as one of those vestigial organs that animals inherit from a distant ancestor - like the appendix on humans.
Note that the subclasses of Numeric
such as Fixnum
and Float
and their kin explictly undefine the new
method. I guess they just didn't bother undefining it for Numeric
as direct instances of this class never really exist, and it does no harm keeping it around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With