DISQUS

DISQUS Hello! Virtuous Code is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

[ANN] alter-ego 1.0.0 Released

Started by avdi · 7 months ago

Today I’m happy to announce the release of AlterEgo, a state-pattern library for Ruby. AlterEgo was born about a year ago, when I found a need to formalize state-based behavior in Ruby objects. I surveyed the existing libraries at the time (a set which, IIRC, consisted of ... Continue reading »

5 comments

  • Nice!
  • This looks pretty nice. I was curious tho, have you looked at Mixology? I was thinking that the state blocks could setup anonymous modules, and instead of the handle blocks you could use normal methods. Each module would correspond to a specific state and get mixed into the object as part of each state transition.
  • It's an approach I've considered, and I may move towards it, although I'm pretty sure I want to stay compatible with explicit state classes. One of the items on the TODO list, however, is being able to define ordinary ordinary methods in state { } blocks instead of using #handle.
  • Looks very clean and nice!
  • Looks very clean and nice!

Add New Comment

Returning? Login