Class: RuboCop::Cop::Legion::Extension::AbsorberMissingAbsorbMethod
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Extension::AbsorberMissingAbsorbMethod
- Defined in:
- lib/rubocop/cop/legion/extension/absorber_missing_absorb_method.rb
Overview
Detects absorber classes inside an ‘Absorbers` namespace that do not define the `absorb` instance method. The framework calls `absorb` when a matching event arrives — without it, the absorber silently drops events.
Constant Summary collapse
- MSG =
'Absorber classes must define an `absorb` method to handle matched events.'
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/rubocop/cop/legion/extension/absorber_missing_absorb_method.rb', line 32 def on_class(node) return unless inside_absorbers_namespace?(node) return if defines_absorb?(node) add_offense(node.identifier) end |