Class: Eventboss::QueueListener

Inherits:
Object
  • Object
show all
Defined in:
lib/eventboss/queue_listener.rb

Class Method Summary collapse

Class Method Details

.select(include: nil, exclude: nil) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/eventboss/queue_listener.rb', line 4

def select(include: nil, exclude: nil)
  listeners = list.values.map(&:name)

  listeners &= include if include
  listeners -= exclude if exclude

  list.select { |_queue, listener| listeners.include?(listener.name) }
end