mirror of https://github.com/fspc/BikeShed-1.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
338 B
15 lines
338 B
class BikeCsvImporter
|
|
module Cleaner
|
|
def clean_value(value)
|
|
value_or_nil strip_value(value)
|
|
end
|
|
|
|
def strip_value(value)
|
|
value.try(:strip).try(:gsub, /\n|\r/, '')
|
|
end
|
|
|
|
def value_or_nil(value)
|
|
return value unless ['?', 'n/a', 'missing', 'unknown', ''].include? value.try(:downcase)
|
|
end
|
|
end
|
|
end
|
|
|