summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--state.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/state.rb b/state.rb
index 2f80ab3..eb2498a 100644
--- a/state.rb
+++ b/state.rb
@@ -243,13 +243,19 @@ class State
# Hold all states of a class
def State.hold(type)
- @@states.select{ |x| x.is_a? self }.each{ |x| x.hold(type) }
+ @@states.select{ |x| x.is_a? self }.map{ |x| x.hold(type) }
+ end
+
+ # Release all states of a class
+ def State.release(type)
+ @@states.select{ |x| x.is_a? self }.map{ |x| x.release(type) }
end
private
# Set this state to true
def rise
return if @active
+ trace "Raising #{self}"
@deps.each{ |x| x.hold(self) }
self.class.rising_edge.call(params)
@active = true