Class: Dallal::Events::EventSubscriber

Inherits:
Object
  • Object
show all
Includes:
Subscriber
Defined in:
lib/dallal/events/event_subscriber.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ EventSubscriber

Returns a new instance of EventSubscriber.



11
12
13
# File 'lib/dallal/events/event_subscriber.rb', line 11

def initialize(payload)
  @payload = payload
end

Instance Method Details

#executeObject



15
16
17
18
19
20
# File 'lib/dallal/events/event_subscriber.rb', line 15

def execute
  if should_create_notifications?
    # Trigger an ActiJob for this notification
    DallalJob.perform_later payload[:class], payload[:id], payload[:event].to_s
  end
end