From: ts Date: 2008-05-08T22:58:36+09:00 Subject: Re: to check for numericality Albert Schlef wrote: > Now, when I do "Kernel.methods" I _do_ see "Float", "Integer" etc in the > list. Is it the method "Kernel.Float" that eventually gets called? How > does ruby know to distinguish between the class Float and the method > Kernel.Float? Because you use it like a method, i.e. you have added () after it Float() ==> method Float ==> constant > > BTW, why, when I do "Object.methods" don't I see "Float", "Integer" etc > in the list? Some more methods too are missing. Object is supposed to > inherit them from Kernel, doesn't it? #Float is a global function, i.e. a Kernel private method and a Kernel singleton method vgs% ruby -e 'p Kernel.singleton_methods.include?("Float")' true vgs% vgs% ruby -e 'p Kernel.private_instance_methods.include?("Float")' true vgs% vgs% ruby -e 'p Object.private_methods.include?("Float")' true vgs% Guy Decoux