lib/cotton_tail/configuration.rb in cotton-tail-0.3.0 vs lib/cotton_tail/configuration.rb in cotton-tail-0.4.0

- old
+ new

@@ -5,13 +5,13 @@ module CottonTail # Configuration options class Configuration attr_reader :connection_args - def initialize + def initialize(middleware: nil) @connection_args = nil - @middleware = Middleware::DEFAULT_STACK + @middleware = middleware @user_configs = {} end # Sets the RabbitMQ connection params. Arguments are eventually passed # to Bunny.new. Any valid params for Bunny.new are accepted. @@ -27,10 +27,10 @@ # @see https://github.com/Ibsciss/ruby-middleware def middleware return @middleware unless block_given? @middleware = ::Middleware::Builder.new do |b| - b.use @middleware + b.use @middleware if @middleware yield b end end def method_missing(method_id, *arguments, &block)