Skip to content

v0.4.0

Choose a tag to compare

@norbajunior norbajunior released this 12 Apr 18:03
· 68 commits to main since this release
6a3bd73

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/2 that expects a state and a block of to statements