vendor/bundle/ruby/1.8/gems/statemachine-2.0.1/lib/statemachine/statemachine.rb
# The key method to exercise the statemachine. Any extra arguments supplied will be passed into
# any actions associated with the transition.
#
# Alternatively to this method, you may invoke methods, names the same as the event, on the statemachine.
# The advantage of using +process_event+ is that errors messages are more informative.
The key method to exercise the statemachine. Any extra arguments supplied will be passed into
any actions associated with the transition.

Alternatively to this method, you may invoke methods, names the same as the event, on the statemachine.
The advantage of using +process_event+ is that errors messages are more informative.
The key method to exercise the statemachine . Any extra arguments supplied will be passed into any actions associated with the transition . Alternatively to this method you may invoke methods names the same as the event on the statemachine . The advantage of using + process_event + is that errors messages are more informative .
def process_event(event, *args)
      event = event.to_sym
      trace "Event: #{event}"
      if @state
        transition = @state.transition_for(event)
        if transition
          transition.invoke(@state, self, args)
        else
          raise TransitionMissingException.new("#{@state} does not respond to the '#{event}' event.")
        end
      else
        raise StatemachineException.new("The state machine isn't in any state while processing the '#{event}' event.")
      end
    end
def process_event ( event , * args ) event = event . to_sym trace "Event: #{event}" if @state transition = @state . transition_for ( event ) if transition transition . invoke ( @state , self , args ) else raise TransitionMissingException . new ( "#{@state} does not respond to the '#{event}' event." ) end else raise StatemachineException . new ( "The state machine isn't in any state while processing the '#{event}' event." ) end end
The key method to exercise the statemachine.
The key method to exercise the statemachine .
event
args