I kind of new at this…please correct me if I’m wrong.
state_machine do
state :red
state :green
state :yellow
---------------a example---------------
event :change_color do
transitions :to => :red, :from => [:yellow], :on_transition =>
:catch_runners
transitions :to => :yellow, :from => [:green]
transitions :to => :green, :from => [:red]
end
end
it turn yellow to red and trigger catch_runners action. we can use
if state == yellow
state = red
catch_runner
end
instead of it.
so why do we needs act_as_state_machine? a wrapper ? make thing simple?