Sha256: 5ad7204904636d0d034a422f236ed2f40c7b4fbbb7baf68a4319dfa4b2a834de
Contents?: true
Size: 359 Bytes
Versions: 19
Compression:
Stored size: 359 Bytes
Contents
module Krikri::Enrichments ## # Strip whitespace # # StripWhitespace.new.enrich_value("\tmoominpapa \t \nmoominmama ") # # => ['moominpapa', 'moominmama'] class StripWhitespace include Krikri::FieldEnrichment def enrich_value(value) return value unless value.is_a? String value.strip.gsub(/\s+/, ' ') end end end
Version data entries
19 entries across 19 versions & 1 rubygems