lib/amq/client/async/callbacks.rb in amq-client-0.7.0.alpha35 vs lib/amq/client/async/callbacks.rb in amq-client-0.8.0

- old
+ new

@@ -1,5 +1,7 @@ +# encoding: utf-8 + module AMQ module Client module Async module Callbacks @@ -32,40 +34,40 @@ @callbacks[event].clear if @callbacks[event] end # clear_callbacks(event) def exec_callback(name, *args, &block) - list = Array(self.callbacks[name]) + list = Array(@callbacks[name]) if list.any? list.each { |c| c.call(*args, &block) } end end def exec_callback_once(name, *args, &block) - list = (self.callbacks.delete(name) || Array.new) + list = (@callbacks.delete(name) || Array.new) if list.any? list.each { |c| c.call(*args, &block) } end end def exec_callback_yielding_self(name, *args, &block) - list = Array(self.callbacks[name]) + list = Array(@callbacks[name]) if list.any? list.each { |c| c.call(self, *args, &block) } end end def exec_callback_once_yielding_self(name, *args, &block) - list = (self.callbacks.delete(name) || Array.new) + list = (@callbacks.delete(name) || Array.new) if list.any? list.each { |c| c.call(self, *args, &block) } end end def has_callback?(name) - self.callbacks[name] && !self.callbacks[name].empty? + @callbacks[name] && !@callbacks[name].empty? end # has_callback? - end # Callbacks + end # Callbacks end # Async end # Client -end # AMQ \ No newline at end of file +end # AMQ