module Cleaners::CompressWhitespace

Compress multiple whitespace to a single space

Constants

WHITESPACE

Public Class Methods

call(string) click to toggle source
# File lib/data_cleansing/cleaners.rb, line 108
def self.call(string)
  return string unless string.is_a?(String)

  string.gsub!(WHITESPACE, ' ') || string
end