state_machine

https://github.com/pluginaweek/state_machine

Ruby

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

StateMachine::State#draw

Draws a representation of this state on the given machine.  This will
create a new node on the graph with the following properties:
* +label+ - The human-friendly description of the state.
* +width+ - The width of the node.  Always 1.
* +height+ - The height of the node.  Always 1.
* +shape+ - The actual shape of the node.  If the state is a final
  state, then "doublecircle", otherwise "ellipse".

Configuration options:
* <tt>:human_name</tt> - Whether to use the state's human name for the
  node's label that gets drawn on the graph

Source | Google | Stack overflow

Edit

git clone [email protected]:pluginaweek/state_machine.git

cd state_machine

open lib/state_machine/state.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-StateMachine--State-draw-for-pr


# Commit to git

git add lib/state_machine/state.rbgit commit -m "better docs for StateMachine::State#draw"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-StateMachine--State-draw-for-pr

hub pull-request


# Celebrate!