lib/metacosm/simulation.rb in metacosm-0.2.2 vs lib/metacosm/simulation.rb in metacosm-0.2.3
- old
+ new
@@ -64,15 +64,15 @@
end
protected
def handler_for(command)
@handlers ||= {}
- @handlers[command] ||= Object.const_get(command.class.name.split('::').last + "Handler").new
+ @handlers[command.class] ||= Object.const_get(command.class.name.split('::').last + "Handler").new
end
def listener_for(event)
@listeners ||= {}
- @listeners[event] ||= construct_listener_for(event)
+ @listeners[event.class] ||= construct_listener_for(event)
end
def construct_listener_for(event)
listener = Object.const_get(event.class.name.split('::').last + "Listener").new(self)
listener