Class: ProfanityFilterEngine::PartialMatchStrategy
- Inherits:
-
RegexpStrategy
- Object
- Component
- RegexpStrategy
- ProfanityFilterEngine::PartialMatchStrategy
- Defined in:
- lib/profanity-filter/engines/partial_match_strategy.rb
Constant Summary collapse
- DEFAULT_IGNORE_CASE =
false
Constants inherited from RegexpStrategy
RegexpStrategy::DEFAULT_DELIMITER
Instance Attribute Summary collapse
-
#ignore_case ⇒ Object
readonly
Returns the value of attribute ignore_case.
Attributes inherited from RegexpStrategy
#dictionary, #profanity_regexp
Instance Method Summary collapse
-
#initialize(dictionary:, ignore_case: DEFAULT_IGNORE_CASE) ⇒ PartialMatchStrategy
constructor
A new instance of PartialMatchStrategy.
Methods inherited from RegexpStrategy
Methods inherited from Component
#profane?, #profane_words, #profanity_count
Constructor Details
#initialize(dictionary:, ignore_case: DEFAULT_IGNORE_CASE) ⇒ PartialMatchStrategy
Returns a new instance of PartialMatchStrategy.
11 12 13 14 15 |
# File 'lib/profanity-filter/engines/partial_match_strategy.rb', line 11 def initialize(dictionary:, ignore_case: DEFAULT_IGNORE_CASE) @dictionary = dictionary @ignore_case = ignore_case @profanity_regexp = build_profanity_regexp end |
Instance Attribute Details
#ignore_case ⇒ Object (readonly)
Returns the value of attribute ignore_case.
9 10 11 |
# File 'lib/profanity-filter/engines/partial_match_strategy.rb', line 9 def ignore_case @ignore_case end |