Class: CatchBox::Emitter

Inherits:
Object
  • Object
show all
Defined in:
lib/catch_box/emitter.rb

Instance Method Summary collapse

Instance Method Details

#call(fanout, pattern, payload) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/catch_box/emitter.rb', line 5

def call(fanout, pattern, payload)
  fanout.select { |hook|
    hook.match?(pattern)
  }.each do |hook|
    hook.call(payload)
  end
end