Module: Cleaners::CompressWhitespace
- Defined in:
- lib/data_cleansing/cleaners.rb
Overview
Compress multiple whitespace to a single space
Constant Summary collapse
- WHITESPACE =
Regexp.compile(/\s+/)
Class Method Summary collapse
Class Method Details
.call(string) ⇒ Object
112 113 114 115 116 |
# File 'lib/data_cleansing/cleaners.rb', line 112 def self.call(string) return string unless string.is_a?(String) string.gsub!(WHITESPACE, " ") || string end |