From 31bdc800eab716e86fc534d2b9291b09b084a51b Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Fri, 3 Oct 2008 17:56:33 -0400 Subject: Add static hold method to State State::hold now holds all states of the given type --- state.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/state.rb b/state.rb index a05cc05..0994c65 100644 --- a/state.rb +++ b/state.rb @@ -217,6 +217,11 @@ class State nil end + # Hold all states of a class + def State.hold(type) + @@states.select{ |x| x.is_a? self }.each{ |x| x.hold(type) } + end + private # Set this state to true def rise -- cgit