In the book (Programming Ruby 1.9 & 2.0), the authors refer to Float in the following context @price = Float(price) as a “method.” It seems that Float is a class, not a method. Am I wrong? I see this topic has been raised before, but based I haven’t found any reference to Float as a method.
Yes, it’s also a Kernel method.
Object.method(:Float).class #=> Method Object.method(:Float).owner #=> Kernel
You must be logged in to comment