class WithEvents::Trigger

Public Instance Methods

call(appearance) click to toggle source
# File lib/with_events/trigger.rb, line 7
def call(appearance)
  Stream.streams.each do |stream|
    process_stream(stream, appearance.to_sym)
  end
end

Private Instance Methods

process_stream(stream, appearance) click to toggle source
# File lib/with_events/trigger.rb, line 15
def process_stream(stream, appearance)
  stream.events.each do |event|
    next unless valid_event?(event, appearance)
    WithEvents::Worker.perform_async(stream.name, event.name, appearance)
  end
end