3
See the class Integer
:
Integer.class
=> Class
It also seems that it is a method, at the same time that it is a class:
Integer 10.5
=> 10
How is this possible in Ruby? Where is this method defined? What mechanisms does Ruby use to know if I’m calling the method or the class?
Thanks for the answer! Can you supplement it with the other questions in the question? " How is this possible in Ruby? Where is this method defined? What mechanisms does Ruby use to know if I’m calling the method or the class?"
– vinibrsl
@vnbrs Please see the edition.
– Ainar-G