class RuboCop::Cop::Lint::NoBangStateMachineEvents

@example

# bad - will define `!`-ended method that won't raise
state_machine :state do
  event :started! do
    ...
  end
end

# good
state_machine :state do
  event :started do
    ...
  end
end

Constants

MSG

Public Instance Methods

on_send(node) click to toggle source
# 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