class String

Public Instance Methods

is_int?(str) click to toggle source
# File lib/ext.rb, line 6
def is_int?(str)
  Integer(str)
  true
rescue ArgumentError
  false
end
numstr_to_i() click to toggle source
# File lib/ext.rb, line 2
def numstr_to_i
  is_int?(self) ? self.to_i : self
end