Module: StateMachine
- Defined in:
- lib/ruby-state-machine/state_machine.rb
Overview
StateMachine Simple and flexible state machine. Define a state machine with an array of states, an array of events, and one or more transition actions. A transition can be as simple as the symbol for the next state, a lambda (code) to execute. Primitive branching can also be achieved if necessary by using a “decider” instance method. Please see StateMachine.state_transition for full details on the variations available. StateMachineTest also contains examples and unit tests for most (if not all) of the available functionality. See README for example.
Defined Under Namespace
Modules: ClassMethods, InstanceMethods Classes: InvalidStateError, Machine
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
12 13 14 |
# File 'lib/ruby-state-machine/state_machine.rb', line 12 def self.included(base) base.extend StateMachine::ClassMethods end |