Module: SpreeCore::Ext::String

Defined in:
lib/spree_core/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#is_integer?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
# File 'lib/spree_core/ext/string.rb', line 2

def is_integer?
  begin
    Integer(self.to_s)
    return true
  rescue ArgumentError
    return false
  end
end