# File lib/state_machine/event.rb, line 244
      def add_actions
        # Checks whether the event can be fired on the current object
        machine.define_instance_method("can_#{qualified_name}?") do |machine, object|
          machine.event(name).can_fire?(object)
        end
        
        # Gets the next transition that would be performed if the event were
        # fired now
        machine.define_instance_method("#{qualified_name}_transition") do |machine, object|
          machine.event(name).transition_for(object)
        end
        
        # Fires the event
        machine.define_instance_method(qualified_name) do |machine, object, *args|
          machine.event(name).fire(object, *args)
        end
        
        # Fires the event, raising an exception if it fails
        machine.define_instance_method("#{qualified_name}!") do |machine, object, *args|
          object.send(qualified_name, *args) || raise(StateMachine::InvalidTransition, "Cannot transition #{machine.name} via :#{name} from #{machine.states.match!(object).name.inspect}")
        end
      end