From 0b5cedf47822497f6ef71fdf641b832b4a3e169e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20B=C3=B6ttger?= Date: Fri, 10 Oct 2014 23:41:59 +0200 Subject: [PATCH] correct wrong events in the inspection section of the README --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cc6beb7..63a816d 100644 --- a/README.md +++ b/README.md @@ -504,22 +504,25 @@ end AASM supports a couple of methods to find out which states or events are provided or permissible. -Given the `Job` class from above: +Given this `Job` class: ```ruby -job = Job.new - -job.aasm.states.map(&:name) +# show all states +Job.aasm.states.map(&:name) => [:sleeping, :running, :cleaning] +job = Job.new + +# show all permissible (reachable / possible) states job.aasm.states(:permissible => true).map(&:name) => [:running] job.run job.aasm.states(:permissible => true).map(&:name) => [:cleaning, :sleeping] +# show all possible (triggerable) events (allowed by transitions) job.aasm.events -=> [:run, :clean, :sleep] +=> [:sleep] ```