def exit!
      map = @transition_map
      map.each do |type, events_to_transition_arrays|
        events_to_transition_arrays.each do |event, transitions|
          transitions.each(&:unarm)
        end
      end

      @exit_actions.each do |exit_action|
        exit_action.call(@state_machine)
      end
      @state_machine.current_state = nil
    end
def exit!
      map = @transition_map
      map.each do |type, events_to_transition_arrays|
        events_to_transition_arrays.each do |event, transitions|
          transitions.each(&:unarm)
        end
      end

      @exit_actions.each do |exit_action|
        exit_action.call(@state_machine)
      end
      @state_machine.current_state = nil
    end
Sets the state machine's current_state to nil, calls all exit
 actions and deactivates triggering mechanisms of all outgoing
 transitions.