class Fluffix::US

Public Class Methods

cleanse(text) click to toggle source
# File lib/fluffix.rb, line 38
def self.cleanse(text)
  raise("Must quack like a string") unless text.respond_to?(:to_s)
  RULES.each do |rule|
    # should return the text in the original form and should handle / ignore punctuation
    if text =~ rule
      result = text.sub(rule, '')
      return result
    end
  end
  return text
end