updated readme to show how a callback Proc works

This commit is contained in:
Thorsten Böttger 2013-05-23 23:26:49 +02:00
parent 7b58f124f5
commit 744689e2cf
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class Job
state :sleeping, :initial => true, :before_enter => :do_something
state :running
event :run, :after => :notify_somebody do
event :run, :after => Proc.new { |user| notify_somebody(user) } do
transitions :from => :sleeping, :to => :running, :on_transition => Proc.new {|obj, *args| obj.set_process(*args) }
end
@ -103,7 +103,7 @@ class Job
...
end
def notify_somebody
def notify_somebody(user)
...
end