Module: MrClean::Profanity

Defined in:
lib/mr_clean/profanity.rb

Constant Summary collapse

BAD_WORDS =
MrClean::Config.hashify('bad_words.yml')

Class Method Summary collapse

Class Method Details

.profane?(text) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/mr_clean/profanity.rb', line 7

def profane?(text)
  text && MrClean::Filter.slice(text).any? { |word| BAD_WORDS[word] }
end