Module: Pupa::Processor::Helper

Included in:
Pupa::Processor
Defined in:
lib/pupa/processor/helper.rb

Overview

Processor helper methods.

Instance Method Summary collapse

Instance Method Details

#clean(string) ⇒ String

Normalizes all whitespace to spaces, removes consecutive spaces, and strips leading and ending spaces.

Parameters:

Returns:



10
11
12
13
14
# File 'lib/pupa/processor/helper.rb', line 10

def clean(string)
  if string
    string.gsub(/[[:space:]]/, ' ').squeeze(' ').strip
  end
end