I'm trying to find an nice way of verifying that the value of a String
object (from the RoR params) contains a positive integer value.
Casting my string to_i and then testing that it is_a(Numeric) and is > 0
doesn't do the trick because the to_i method converts something like
'1.1' to a Fixnum of value 1 which would then pass the test when it
I feel certain I must be missing a trick here...am about to go down the
path of regexp which feels...wrong?
Any advice for a newcomer would be gratefully received!
Posted via http://www.ruby-forum.com/.