diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 10:56:34 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 10:56:34 -0400 |
commit | 415e277bff45093b7c359270317a5d0b47ff2687 (patch) | |
tree | a921832859f6c3e2a07db064a09582afbd6e9814 /state.rb | |
parent | bc5e3bb025d247629b7175f9676d3a2da765142d (diff) | |
download | upstate-415e277bff45093b7c359270317a5d0b47ff2687.tar.gz upstate-415e277bff45093b7c359270317a5d0b47ff2687.tar.xz upstate-415e277bff45093b7c359270317a5d0b47ff2687.zip |
Fix bugs in State::process_event
State::process_event was only checking states that were up, when it should do
the opposite, and wasn't forwarding parameters from the event.
Diffstat (limited to 'state.rb')
-rw-r--r-- | state.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -239,9 +239,9 @@ class State def State.process_event(event) raise TypeError unless event.is_a? Event count = 0 - @@states.select{ |x| x.status == :up }.each do + @@states.select{ |x| x.status == :down }.each do |x| next unless x.react_to? event - x.hold(:system) + x.hold(:system, event.params) count += 1 end count |