Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/importex/ruby_additions.rb

Class Method Summary collapse

Class Method Details

.importex_value(str) ⇒ Object



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

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