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

Adds Class Invoker documentation on README

This commit is contained in:
José Gomes Júnior 2018-11-29 11:02:10 -02:00 committed by Anil Kumar Maurya
parent 57ffc986a8
commit e28d5a4efb

View file

@ -385,6 +385,21 @@ If you prefer a more Ruby-like guard syntax, you can use `if` and `unless` as we
end
```
You can invoke a Class instead a method since this Class responds to `call`
```ruby
event :sleep do
transitions :from => :running, :to => :sleeping, :guards => Dog
end
```
```ruby
class Dog
def call
cleaning_needed? && walked?
end
...
end
```
### Transitions