lib/contextr/event_machine.rb in contextr-0.1.1 vs lib/contextr/event_machine.rb in contextr-0.1.9

- old
+ new

@@ -2,11 +2,11 @@ class EventMachine # :nodoc: all module ClassMethods include UniqueId def listeners - @listeners ||= { :method_added => {} } + @listeners ||= {:method_added => {}} end def register(listener, callback, options) observed = check_options_hash(options) register_observers_on_demand(observed) @@ -18,11 +18,11 @@ self.listeners[observed[:event]][observed[:module]].delete(listener) end def on_method_added(modul, name) version = self.new_unique_id - self.listeners[:method_added][modul].each do | listener, method_name | - listener.send( method_name, modul, name, version ) + self.listeners[:method_added][modul].to_a.each do |listener, method| + listener.send(method, modul, name, version) end end def check_options_hash(options) observed = {}