Module: Daru::IOHelpers

Defined in:
lib/daru/io/io.rb

Class Method Summary collapse

Class Method Details

.process_row(row, empty) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/daru/io/io.rb', line 4

def process_row(row,empty)
  row.to_a.map do |c|
    if empty.include?(c)
      nil
    else
      if c.is_a? String and c.is_number?
        c =~ /^\d+$/ ? c.to_i : c.gsub(",",".").to_f
      else
        c
      end
    end
  end
end