From 8b9ad865a45c268d79bdf9c18fddd271c5c62c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20B=C3=B6ttger?= Date: Wed, 29 Jan 2014 21:34:33 +0100 Subject: [PATCH] fixed README: currently after and before callbacks do not support arguments (will come with new major version 4, since this change includes a DSL change) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cd17075a..414d0a84 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ class Job state :sleeping, :initial => true, :before_enter => :do_something state :running - event :run, :after => Proc.new { |user| notify_somebody(user) } do + event :run, :after => Proc.new { do_afterwards } do transitions :from => :sleeping, :to => :running, :on_transition => Proc.new {|obj, *args| obj.set_process(*args) } end @@ -117,7 +117,7 @@ class Job ... end - def notify_somebody(user) + def do_afterwards ... end @@ -125,7 +125,7 @@ end ``` In this case `do_something` is called before actually entering the state `sleeping`, -while `notify_somebody` is called after the transition `run` (from `sleeping` to `running`) +while `do_afterwards` is called after the transition `run` (from `sleeping` to `running`) is finished. Here you can see a list of all possible callbacks, together with their order of calling: