Updates 'Callbacks' section example to be correct

The current example is trying to define a before block inside of a
transition block, which is not a supported callback.  Moving the before
block in to the event block for an example that is supported.
This commit is contained in:
Naveed Kakal 2015-08-24 19:06:27 -05:00
parent 4ea38fc6fc
commit 81c4dea66f
1 changed files with 4 additions and 4 deletions

View File

@ -99,11 +99,11 @@ class Job
state :running
event :run, :after => :notify_somebody do
transitions :from => :sleeping, :to => :running, :after => Proc.new {|*args| set_process(*args) } do
before do
log('Preparing to run')
end
end
transitions :from => :sleeping, :to => :running, :after => Proc.new {|*args| set_process(*args) }
end
event :sleep do