Module: InciScore::Normalizer::Rules::Sanitizer

Extended by:
Sanitizer
Included in:
Sanitizer
Defined in:
lib/inci_score/normalizer_rules.rb

Constant Summary collapse

INVALID_CHARS =
/[^\/\[\]\(\)\w\s-]/.freeze

Instance Method Summary collapse

Instance Method Details

#call(src) ⇒ Object



66
67
68
69
70
# File 'lib/inci_score/normalizer_rules.rb', line 66

def call(src)
  Array(src).map do |token|
    token.gsub(INVALID_CHARS, '')
  end.reject(&:empty?)
end