Class: AnedotWebhooks::WebhooksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/anedot_webhooks/webhooks_controller.rb

Instance Method Summary collapse

Instance Method Details

#receiveObject



5
6
7
8
9
10
# File 'app/controllers/anedot_webhooks/webhooks_controller.rb', line 5

def receive
  event = Event.new(name: @payload["event"], payload: @payload["payload"])
  ActiveSupport::Notifications.instrument(event.notification_name, event: event)
  ActiveSupport::Notifications.instrument("anedot_webhooks.event", event: event)
  head :ok
end