lib/cotton_tail/dsl/routes.rb in cotton-tail-0.6.1 vs lib/cotton_tail/dsl/routes.rb in cotton-tail-0.7.0
- old
+ new
@@ -8,20 +8,20 @@
attr_reader :queues
def initialize(queue_strategy:, connection:)
@queue_strategy = queue_strategy
@connection = connection
- @queues = {}
+ @queues = []
end
def draw(&block)
instance_eval(&block)
end
# Define a new queue
- def queue(name, **opts, &block)
+ def queue(name = '', **opts, &block)
@queue_strategy.call(name: name, connection: @connection, **opts).tap do |queue_instance|
- @queues[name] = queue_instance
+ @queues << queue_instance
queue_dsl = Queue.new(name, queue_instance, self)
queue_dsl.instance_eval(&block) if block_given?
end
end