Class: Profanity::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/profanity/base.rb

Class Method Summary collapse

Class Method Details

.blacklistObject



5
6
7
# File 'lib/profanity/base.rb', line 5

def blacklist
  @blacklist = Profanity::Config::BLACKLIST
end

.profane?(text) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
# File 'lib/profanity/base.rb', line 9

def profane?(text)
  profane = false
  blacklist.each do |word|
    if text.include? word
      profane = true; break
    end
  end
  profane
end