lib/legion/extensions/transport.rb in legionio-0.3.1 vs lib/legion/extensions/transport.rb in legionio-0.3.2

- old
+ new

@@ -65,18 +65,20 @@ transport_class::Queues.const_set(queue.split('::').last, Class.new(Legion::Transport::Queue)) end def auto_create_dlx_exchange - return if transport_class::Exchanges.const_defined? 'Dlx' + dlx = if transport_class::Exchanges.const_defined? 'Dlx' + transport_class::Exchanges::Dlx + else + transport_class::Exchanges.const_set('Dlx', Class.new(default_exchange) do + def exchange_name + "#{super}.dlx" + end + end) + end - dlx = transport_class::Exchanges.const_set('Dlx', Class.new(default_exchange) do - def exchange_name - "#{super}.dlx" - end - end) dlx.new - dlx end def auto_create_dlx_queue return if transport_class::Queues.const_defined?('Dlx')