state_machine
https://github.com/pluginaweek/state_machine
Ruby
Adds support for creating state machines for attributes on any Ruby class
StateMachine::ClassMethods#state_machines
Gets the current list of state machines defined for this class. This
class-level attribute acts like an inheritable attribute. The attribute
is available to each subclass, each having a copy of its superclass's
attribute.
The hash of state machines maps <tt>:attribute</tt> => +machine+, e.g.
Vehicle.state_machines # => {:state => #<StateMachine::Machine:0xb6f6e4a4 ...>}Edit
git clone [email protected]:pluginaweek/state_machine.git
cd state_machine
open lib/state_machine/extensions.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-StateMachine--ClassMethods-state_machines-for-pr
# Commit to gitgit add lib/state_machine/extensions.rbgit commit -m "better docs for StateMachine::ClassMethods#state_machines"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-StateMachine--ClassMethods-state_machines-for-pr
hub pull-request
# Celebrate!