diff options
| -rw-r--r-- | state.rb | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |
