Class: PoliteText::Base
- Inherits:
-
Object
- Object
- PoliteText::Base
- Defined in:
- lib/polite_text/base.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#swear_words ⇒ Object
5 6 7 |
# File 'lib/polite_text/base.rb', line 5 def swear_words @swear_words ||= /\b(#{Regexp.union(swear_words_list).source})\b/ end |
#swear_words_list ⇒ Object
9 10 11 12 |
# File 'lib/polite_text/base.rb', line 9 def swear_words_list() path = custom_swear_words_path ? custom_swear_words_path.to_s : swear_words_load_path YAML.load_file(path)['swear_words'] end |