Class: RuboCop::Cop::Legion::Extension::AbsorberMissingPattern
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Extension::AbsorberMissingPattern
- Defined in:
- lib/rubocop/cop/legion/extension/absorber_missing_pattern.rb
Overview
Detects absorber classes inside an Absorbers namespace that do not call
the pattern DSL method. Without pattern, the absorber will not match
any events and will be silently inactive.
Constant Summary collapse
- MSG =
'Absorber classes must call the `pattern` DSL method to match events.'
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/rubocop/cop/legion/extension/absorber_missing_pattern.rb', line 34 def on_class(node) return unless inside_absorbers_namespace?(node) return if calls_pattern?(node) add_offense(node.identifier) end |