Class: Obscenity::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/obscenity/config.rb

Constant Summary collapse

DEFAULT_WHITELIST =
[]
DEFAULT_BLACKLIST =
File.dirname(__FILE__) + "/../../config/blacklist.yml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Config

Returns a new instance of Config.

Yields:

  • (_self)

Yield Parameters:



9
10
11
12
# File 'lib/obscenity/config.rb', line 9

def initialize
  yield(self) if block_given?
  validate_config_options
end

Instance Attribute Details

#replacementObject

Returns the value of attribute replacement.



4
5
6
# File 'lib/obscenity/config.rb', line 4

def replacement
  @replacement
end

Instance Method Details

#blacklistObject



18
19
20
# File 'lib/obscenity/config.rb', line 18

def blacklist
  @blacklist ||= DEFAULT_BLACKLIST
end

#blacklist=(value) ⇒ Object



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

def blacklist=(value)
  @blacklist = value == :default ? DEFAULT_BLACKLIST : value
end

#whitelistObject



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

def whitelist
  @whitelist ||= DEFAULT_WHITELIST
end

#whitelist=(value) ⇒ Object



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

def whitelist=(value)
  @whitelist = value == :default ? DEFAULT_WHITELIST : value
end