lib/csv2hash/parser.rb in csv2hash-0.7.2 vs lib/csv2hash/parser.rb in csv2hash-0.7.3

- old
+ new

@@ -1,4 +1,16 @@ module Csv2hash module Parser + + def treat(content) + return content unless self.options.fetch(:sanitizer){false} + sanitize(content) + end + + private + + def sanitize(content) + return content unless content.is_a?(String) + content.gsub(/[\s]+/, ' ').strip + end end end