class PoliteText::TextCleaner

Attributes

text[R]

Public Class Methods

new(text) click to toggle source
# File lib/polite_text/text_cleaner.rb, line 5
def initialize(text)
  raise ArgumentError.new('The text can not be nil') if text.nil?

  @text = text.to_s
end

Public Instance Methods

clean!() click to toggle source
# File lib/polite_text/text_cleaner.rb, line 11
def clean!
  text.gsub!(swear_words, '***') || text
end