Does Rails 3 or Ruby have a built-in way to check if a variable is an integer?
For example,
1.is_an_int #=> true \"dadadad@asdasd.net\".is_an_int
There's var.is_a? Class (in your case: var.is_a? Integer); that might fit the bill. Or there's Integer(var), where it'll throw an exception if it can't parse it.
var.is_a? Class
var.is_a? Integer
Integer(var)