From e28d5a4efb889a2b19752da88a4cca6396842a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gomes=20J=C3=BAnior?= Date: Thu, 29 Nov 2018 11:02:10 -0200 Subject: [PATCH] Adds Class Invoker documentation on README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 1a33b34..ca881f6 100644 --- a/README.md +++ b/README.md @@ -385,6 +385,21 @@ If you prefer a more Ruby-like guard syntax, you can use `if` and `unless` as we end ``` +You can invoke a Class instead a method since this Class responds to `call` + +```ruby + event :sleep do + transitions :from => :running, :to => :sleeping, :guards => Dog + end +``` +```ruby + class Dog + def call + cleaning_needed? && walked? + end + ... + end +``` ### Transitions