method

state_machine

state_machine(name = nil, options = {}, &block)
public

No documentation available.

# File activemodel/lib/active_model/state_machine.rb, line 25
      def state_machine(name = nil, options = {}, &block)
        if name.is_a?(Hash)
          options = name
          name    = nil
        end
        name ||= :default
        state_machines[name] ||= Machine.new(self, name)
        block ? state_machines[name].update(options, &block) : state_machines[name]
      end