Registry / utility / finite-machine

finite-machine

JSON →
library0.14.1rbrubygemsunverified

A minimal finite state machine with a straightforward syntax for modeling states, adding callbacks, and integrating with ORMs.

gem install finite_machine
INSTALL
IMPORT
SIG · FINITE-MACHINE
F
finite-machine
utilityrubyv0.14.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FiniteMachine
require 'finite_machine'

Define a simple traffic light state machine with events and transitions.

require 'finite_machine' fsm = FiniteMachine.new do initial :green event :slow, :green => :yellow event :stop, :yellow => :red event :ready, :red => :yellow event :go, :yellow => :green end fsm.slow puts fsm.current # => :yellow
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.14.1latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
finite-machine — gem install finite-machine · libregistry