v0.4.0
Add a new way to set from transitions. With this new feature we can group many from definitions with a same state.
# ...
transitions do
from :locked, to: :unlocked, event: "unlock"
from :unlocked do
to :locked, event: "lock"
to :opened, event: "open"
end
from :opened, to: :closed, event: "close"
from :closed, to: :opened, event: "open"
from :closed, to: :locked, event: "lock"
end
# ...- implemented macro
Machinist.from/2that expects astateand a block oftostatements