Module: Obscenity

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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
'1.0.1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



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

def config
  @config
end

Instance Method Details

#configure(&block) ⇒ Object



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

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

#offensive(text) ⇒ Object



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

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

#profane?(word) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#replacement(chars) ⇒ Object



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

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

#sanitize(text) ⇒ Object



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

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