lib/stateflow.rb in stateflow-0.0.4 vs lib/stateflow.rb in stateflow-0.1.0
- old
+ new
@@ -47,18 +47,19 @@
def machine
self.class.machine
end
private
- def fire_event(event)
- event = machine.events[event.to_sym]
- raise Exception.new("No event matches #{event}") if event.nil?
+ def fire_event(event_name)
+ event = machine.events[event_name.to_sym]
+ raise Stateflow::NoEventFound.new("No event matches #{event_name}") if event.nil?
event.fire(current_state, self)
end
end
autoload :Machine, 'stateflow/machine'
autoload :State, 'stateflow/state'
autoload :Event, 'stateflow/event'
autoload :Transition, 'stateflow/transition'
autoload :Persistence, 'stateflow/persistence'
+ autoload :Exception, 'stateflow/exception'
end