lib/emittance/watcher.rb in emittance-0.0.3 vs lib/emittance/watcher.rb in emittance-0.0.4
- old
+ new
@@ -14,12 +14,18 @@
# @param callback [Block] the other option for adding a callback--the block you wish to be executed when the event
# fires
# @return [Proc] the block that will run when the event fires
def watch(identifier, callback_method = nil, &callback)
if callback_method
- Emittance::Dispatcher.register_method_call identifier, self, callback_method
+ _dispatcher.register_method_call identifier, self, callback_method
else
- Emittance::Dispatcher.register identifier, &callback
+ _dispatcher.register identifier, &callback
end
+ end
+
+ private
+
+ def _dispatcher
+ Emittance.dispatcher
end
end
end