diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-03 17:56:33 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-03 17:56:33 -0400 |
commit | 31bdc800eab716e86fc534d2b9291b09b084a51b (patch) | |
tree | 6c1a612713bd1e406025a79afdbc53275a16e4f5 | |
parent | 1e69719c7b424e26a5430488eb06099269e14164 (diff) | |
download | upstate-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
-rw-r--r-- | state.rb | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |