lib/micromachine.rb in soveran-micromachine-0.0.2 vs lib/micromachine.rb in soveran-micromachine-0.0.4
- old
+ new
@@ -17,15 +17,14 @@
attr :events
attr :state
def initialize initial_state
@state = initial_state
- @events = Hash.new { |hash, key| hash[:key] = [] }
+ @events = Hash.new
end
def fire event
- if new_state = events[event][@state]
- yield if block_given?
- @state = new_state
+ if events[event][@state]
+ @state = events[event][@state]
end
end
end