Sha256: 59362b170bd5599beed338452a7eb70bd8816c7a2787cd21ab80fc004a2b3a4b
Contents?: true
Size: 535 Bytes
Versions: 11
Compression:
Stored size: 535 Bytes
Contents
module Csv2hash class TypeCoercer < Struct.new(:data) def deserialize! data.each do |line| line.each do |key, value| _value = value.to_s.strip.downcase change.each do |keys, v| line[key] = v if keys.include?(_value) end end end end private def change { Csv2hash.configuration.true_values => true, Csv2hash.configuration.false_values => false, Csv2hash.configuration.nil_values => nil, } end end end
Version data entries
11 entries across 11 versions & 1 rubygems