summaryrefslogtreecommitdiffstats
path: root/state.rb
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-10-03 17:56:33 -0400
committerCasey Dahlin <cdahlin@redhat.com>2008-10-03 17:56:33 -0400
commit31bdc800eab716e86fc534d2b9291b09b084a51b (patch)
tree6c1a612713bd1e406025a79afdbc53275a16e4f5 /state.rb
parent1e69719c7b424e26a5430488eb06099269e14164 (diff)
downloadupstate-31bdc800eab716e86fc534d2b9291b09b084a51b.tar.gz
upstate-31bdc800eab716e86fc534d2b9291b09b084a51b.tar.xz
upstate-31bdc800eab716e86fc534d2b9291b09b084a51b.zip
Add static hold method to State
State::hold now holds all states of the given type
Diffstat (limited to 'state.rb')
-rw-r--r--state.rb5
1 files changed, 5 insertions, 0 deletions
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