mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Updated README.md to refect actual code necessary to get states
Code listing for Inspection did not reflect the code necessary to produce the output that was indicated. job.aasm.states produces an array of AASM::State objects, which need mapping to produce the symbols necessary.
This commit is contained in:
parent
85ed696500
commit
76484b39c5
1 changed files with 3 additions and 3 deletions
|
@ -431,13 +431,13 @@ Given the `Job` class from above:
|
|||
```ruby
|
||||
job = Job.new
|
||||
|
||||
job.aasm.states
|
||||
job.aasm.states.map { | state | state.name }
|
||||
=> [:sleeping, :running, :cleaning]
|
||||
|
||||
job.aasm.states(:permissible => true)
|
||||
job.aasm.states(:permissible => true).map { | state | state.name }
|
||||
=> [:running]
|
||||
job.run
|
||||
job.aasm.states(:permissible => true)
|
||||
job.aasm.states(:permissible => true).map { | state | state.name }
|
||||
=> [:cleaning, :sleeping]
|
||||
|
||||
job.aasm.events
|
||||
|
|
Loading…
Reference in a new issue