peter-murach/finite_machine — pull request #6 by d4rk5eed (2014-05-07 09:00:46+00:00)
Title: Few conditions for one transition

I need machine which can change state by one event depending on conditions.
Simple example:
```
FiniteMachine.define do
target context

initial context.state

events {
event :next, :company_form => :agreement_form , unless: -> (registrant, user) { user.has_promo? }
event :next, :company_form => :promo_form, if: -> (registrant, user) { user.has_promo? }
}
end
```
*Sorry haven't attached vivid state diagram for this case, but can do it for wiki.*
I've figured out that hash of transitions stores them like
```
transition[source_state][event]=dest_state
```
so I have to replace it with
```
transition[source_state][event]=[ { target: dest_state_1, cond: cond_proc_1 }, { target: dest_state_2, cond: cond_proc_2 } .... ]
```
And fix other logic for this updates.
Also I've added two tests for this logic.