FSM::Machine
Represents a finite state machine.
@property id [String] The unique identifier of the state machine. @property states [Hash(String, State)] A collection of states associated with the state machine. @property initial_state [State] The initial state of the state machine. @property current_state [State] The current state of the state machine.
Class methods
Create a new state machine with the given identifier, states, and initial state.
@param id [String] The unique identifier of the state machine. @param states [Array(State)] The states associated with the state machine. @param context [Hash(String, Any)] Optional initial data to be registered in the context. @yieldparam self [Machine] The machine instance to be configured.
Create a new state machine with the given identifier, states, initial state, and execute a block to set up additional configurations.
@param id [String] The unique identifier of the state machine. @param states [Array(State)] The states associated with the state machine. @param context [Hash(String, Any)] Optional initial data to be registered in the context. @yieldparam self [Machine] The machine instance to be configured.