updated readme to show how a callback Proc works
This commit is contained in:
parent
7b58f124f5
commit
744689e2cf
|
@ -80,7 +80,7 @@ class Job
|
||||||
state :sleeping, :initial => true, :before_enter => :do_something
|
state :sleeping, :initial => true, :before_enter => :do_something
|
||||||
state :running
|
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) }
|
transitions :from => :sleeping, :to => :running, :on_transition => Proc.new {|obj, *args| obj.set_process(*args) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class Job
|
||||||
...
|
...
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify_somebody
|
def notify_somebody(user)
|
||||||
...
|
...
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue