Registry / utility / state-machines

state-machines

JSON →
library0.201.0rbrubygemsunverified

Adds support for creating state machines for attributes on any Ruby class.

gem install state_machines
INSTALL
IMPORT
SIG · STATE-MACHINES
S
state-machines
utilityrubyv0.201.0
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.

StateMachines
require 'state_machines'

Define a state machine on a class with an initial state and an event.

require 'state_machines' class Vehicle state_machine :state, initial: :parked do event :ignite do transition parked: :idling end end end car = Vehicle.new car.ignite puts car.state # => idling
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.201.0latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
state-machines — gem install state-machines · libregistry