# File lib/state_machine/machine.rb, line 1350
      def define_event_helpers
        # Gets the events that are allowed to fire on the current object
        define_instance_method(attribute(:events)) do |machine, object|
          machine.events.valid_for(object).map {|event| event.name}
        end
        
        # Gets the next possible transitions that can be run on the current
        # object
        define_instance_method(attribute(:transitions)) do |machine, object, *args|
          machine.events.transitions_for(object, *args)
        end
        
        # Add helpers for interacting with the action
        if action
          # Tracks the event / transition to invoke when the action is called
          event_attribute = attribute(:event)
          event_transition_attribute = attribute(:event_transition)
          @instance_helper_module.class_eval do
            attr_writer event_attribute
            
            protected
              attr_accessor event_transition_attribute
          end
          
          # Interpret non-blank events as present
          define_instance_method(attribute(:event)) do |machine, object|
            event = machine.read(object, :event, true)
            event && !(event.respond_to?(:empty?) && event.empty?) ? event.to_sym : nil
          end
        end
      end