Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/modesty/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#to_i?Boolean

casts to an integer if applicable, else leaves it alone.

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/modesty/core_ext/string.rb', line 4

def to_i?
  Integer(self)
rescue
  self
end