File: squish_normalizer.rb

package info (click to toggle)
ruby-attribute-normalizer 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 108 kB
  • sloc: ruby: 213; makefile: 7
file content (9 lines) | stat: -rw-r--r-- 216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
module AttributeNormalizer
  module Normalizers
    module SquishNormalizer
      def self.normalize(value, options = {})
        value.is_a?(String) ? value.strip.gsub(/\s+/, ' ') : value
      end
    end
  end
end