Flowdock
method

new

Importance_0
v2.3.8 - Show latest stable - 0 notes - Class: ActiveModel::StateMachine::Event
new(machine, name, options = {}, &block) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/state_machine/event.rb, line 8
      def initialize(machine, name, options = {}, &block)
        @machine, @name, @transitions = machine, name, []
        if machine
          machine.klass.send(:define_method, "#{name}!") do |*args|
            machine.fire_event(name, self, true, *args)
          end

          machine.klass.send(:define_method, name.to_s) do |*args|
            machine.fire_event(name, self, false, *args)
          end
        end
        update(options, &block)
      end
Register or log in to add new notes.