Ruby nested statechart