1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Improve readability

This commit is contained in:
David Stuebe 2020-10-22 19:02:30 -04:00 committed by Anil Kumar Maurya
parent a3fbbcdae6
commit ea041603fb

View file

@ -224,12 +224,14 @@ All guards and after callbacks will receive these parameters. In this case `set_
`:defragmentation` argument.
If the first argument to the event is a state (e.g. `:running` or `:finished`), the argument is consumed and
the statemachine will attempt to transition to that state. To avoid any ambiguity use keyword args.
the state machine will attempt to transition to that state. To avoid any ambiguity, we recommend using keyword
args like so:
```ruby
job = Job.new
job.run(process: :defragmentation)
```
In this case `set_process` would be called with the argument `{process: :defragmentation}`
#### Error Handeling
In case of an error during the event processing the error is rescued and passed to `:error`