module Pupa::Processor::Helper
Processor
helper methods.
Public Instance Methods
clean(string)
click to toggle source
Normalizes all whitespace to spaces, removes consecutive spaces, and strips leading and ending spaces.
@param [String] a string @return [String] a clean string
# File lib/pupa/processor/helper.rb, line 10 def clean(string) if string string.gsub(/[[:space:]]/, ' ').squeeze(' ').strip end end