module Finite::ClassMethods

The class methods for any class that include the finite base

Public Instance Methods

finite(opts, &block) click to toggle source

The finite method for the dsl

@param opts [Hash] any options including initial state @param block [Block] the block of code that creates the state machine

# File lib/finite/class_methods.rb, line 8
def finite(opts, &block)
  StateMachine.machines ||= Hash.new
  StateMachine.machines[self] = StateMachine.new(opts[:initial], self, &block)
end