Class: RuboCop::Cop::Lint::NoBangStateMachineEvents
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Lint::NoBangStateMachineEvents
- Defined in:
- lib/rubocop/cop/lint/no_bang_state_machine_events.rb
Overview
Constant Summary collapse
- MSG =
"Event names ending with a `!` define `!`-ended methods that do not raise"
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rubocop/cop/lint/no_bang_state_machine_events.rb', line 26 def on_send(node) return unless (event_name = is_state_machine_event?(node)) return unless is_state_machine?(node.parent.parent) return unless event_name.match?(/\w+!$/) add_offense(node) end |