Class: Poper2::Rule::Generic
- Inherits:
-
Rule
- Object
- Rule
- Poper2::Rule::Generic
show all
- Defined in:
- lib/poper2/rule/generic.rb
Instance Method Summary
collapse
Methods inherited from Rule
all, inherited, #initialize
Instance Method Details
#check(message) ⇒ Object
4
5
6
7
|
# File 'lib/poper2/rule/generic.rb', line 4
def check(message)
words = message.scan(/[\w-]+/).compact
error_message if words.all? { |word| generic?(word) }
end
|
#enabled? ⇒ Boolean
9
10
11
|
# File 'lib/poper2/rule/generic.rb', line 9
def enabled?
@config.disallow_generic_enabled.to_s == 'true'
end
|