Method: String#is_i?

Defined in:
lib/toolbox/integer.rb

#is_i?Boolean

Adds the ability to check if String is an integer (both positive and negative values accepted)

Returns:

  • (Boolean)


6
7
8
# File 'lib/toolbox/integer.rb', line 6

def is_i?
  !self.match(/^[-+]?[0-9]+$/).nil?
end