Class: PartyLocationHandler

Inherits:
Object
  • Object
show all
Defined in:
app/subscribers/party_location_handler.rb

Instance Method Summary collapse

Instance Method Details

#call(event) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/subscribers/party_location_handler.rb', line 4

def call(event)
  party = Party.find_by(id: event.data[:party_id])
  return unless party

  context = Campaign::DripContext.new(
    party:,
    latitude: event.data[:latitude],
    longitude: event.data[:longitude]
  )
  Campaign::AssignDripCampaigns.new.process(context)
end