Module: Cleaners::RemoveNonWord
- Defined in:
- lib/data_cleansing/cleaners.rb
Overview
Remove all non-word characters, including whitespace
Constant Summary collapse
- NOT_WORDS =
Regexp.compile(/\W/)
Class Method Summary collapse
Class Method Details
.call(string) ⇒ Object
37 38 39 40 41 |
# File 'lib/data_cleansing/cleaners.rb', line 37 def self.call(string) return string unless string.is_a?(String) string.gsub!(NOT_WORDS, "") || string end |