Forum: Ruby Integer(nil) and checking numericality

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-03-10 05:20
(Received via mailing list)
Why does Integer(nil) return 0?  Isn't the point of Integer to assert
that the arg is actually an integer?  (If we just want a best guess, we
can do '323aaadsfwefsd'.to_i or ''.to_i )/
This topic is locked and can not be replied to.