Class: Poper2::Rule::Generic

Inherits:
Rule
  • Object
show all
Defined in:
lib/poper2/rule/generic.rb

Instance Method Summary collapse

Methods inherited from Rule

all, inherited, #initialize

Constructor Details

This class inherits a constructor from Poper2::Rule::Rule

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/poper2/rule/generic.rb', line 9

def enabled?
  @config.disallow_generic_enabled.to_s == 'true'
end