Skip to main content

The State_Machine Gem Discussion

General • Asked by Chris Oliver

Awesome! Chris, this is very useful. Thank you.

You're welcome! :)


Thanks Chris for your useful Screencasts video. This is very useful.


thanks Chris for this info, very useful.


This was really good I love hearing/learning/ finding out about these little things that I dont think about or know about yet being a fresh programmer. From an experienced programmer, what would maybe be a cool app to make to help with practicing this even if it was just in one ruby file.

I think coming up with a simple 'idea' or 'game' to build to practice the idea comes so hard so that would be helpfull thanks man for all your services!

A crazy in-depth example is this for video games: http://jessewarden.com/2012...

They are a fantastic use case for state machines because you've got to keep track of so many things when it comes to power ups. Take just the ghosts in pacman for example: http://oddwiring.com/archiv...

I would say that if you want to try this out, try building a soda machine where you type in the various coins you put into the machine and it counts up and dispenses the soda (and change) once you've hit the correct price. You can just write these events out as strings into the console and that would be a good first experience with it.

Great response thanks man I'm going to try that out!


I think https://github.com/state-ma... is the latest version for rails. Why don't you use it?

I think you are right! I have just not used the gem that often since the last time and this wasn't available then. It does seem to be a community supported version that is the most up to date. Thanks for sharing!


Hi Chris! Would it be possible to do more videos on state machines in regard to multiple conditions for each event and also something on views? Thanks a bunch!


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.