Class: Integer

Inherits:
Object show all
Defined in:
lib/importex/core_ext/importex_value.rb

Class Method Summary collapse

Class Method Details

.importex_value(str) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/importex/core_ext/importex_value.rb', line 2

def self.importex_value(str)
  unless str.blank?
    if str =~ /^[-]{0,1}[.\d]+$/
      str.to_i
    else
      raise Importex::InvalidCell, "Not a number."
    end
  end
end