Module: WisperEvent::Patches::Publisher

Defined in:
lib/wisper_event/patches/publisher.rb

Instance Method Summary collapse

Instance Method Details

#broadcast(event, *args, **kwargs) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/wisper_event/patches/publisher.rb', line 6

def broadcast(event, *args, **kwargs)
  registrations.each do |registration|
    if event.is_a?(String) || event.is_a?(Symbol)
      registration.broadcast(clean_event(event), self, *args, **kwargs)
    else
      # Structured event - pass them directly
      registration.broadcast(event, self, *args, **kwargs)
    end
  end
  self
end