Module: Obscenity

Extended by:
Obscenity
Included in:
Obscenity
Defined in:
lib/obscenity/base.rb,
lib/obscenity.rb,
lib/obscenity/error.rb,
lib/obscenity/config.rb,
lib/obscenity/version.rb

Overview

lib/config.rb

Defined Under Namespace

Classes: Base, Config, EmptyContentList, Error, UnkownContent, UnkownContentFile

Constant Summary collapse

DEFAULT_BLACKLIST =
File.expand_path('../../config/blacklist.yml', __dir__)
DEFAULT_WHITELIST =
[]
VERSION =
'1.0.2'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



13
14
15
# File 'lib/obscenity.rb', line 13

def config
  @config
end

Instance Method Details

#configure(&block) ⇒ Object



15
16
17
# File 'lib/obscenity.rb', line 15

def configure(&block)
  @config = Config.new(&block)
end

#offensive(text) ⇒ Object



35
36
37
# File 'lib/obscenity.rb', line 35

def offensive(text)
  Obscenity::Base.offensive(text)
end

#profane?(word) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/obscenity.rb', line 23

def profane?(word)
  Obscenity::Base.profane?(word)
end

#replacement(chars) ⇒ Object



31
32
33
# File 'lib/obscenity.rb', line 31

def replacement(chars)
  Obscenity::Base.replacement(chars)
end

#sanitize(text) ⇒ Object



27
28
29
# File 'lib/obscenity.rb', line 27

def sanitize(text)
  Obscenity::Base.sanitize(text)
end