Sha256: 51b51159ac3563344e3f15424d13bc964e15dc2788e117e5b6eb0d16b3be115b

Contents?: true

Size: 301 Bytes

Versions: 4

Compression:

Stored size: 301 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
csv2hash-0.7.7 lib/csv2hash/parser.rb
csv2hash-0.7.6 lib/csv2hash/parser.rb
csv2hash-0.7.5 lib/csv2hash/parser.rb
csv2hash-0.7.3 lib/csv2hash/parser.rb