Class: Zaikio::Webhooks::WebhooksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/zaikio/webhooks/webhooks_controller.rb

Instance Method Summary collapse

Instance Method Details

#receive_eventObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/zaikio/webhooks/webhooks_controller.rb', line 7

def receive_event
  Zaikio::Webhooks.webhooks_for(params[:client_name], event_params[:name])
                  .each do |job_klass, options|
    job_klass.public_send(options[:perform_now] ? :perform_now : :perform_later,
                          Zaikio::Webhooks::Event.new(event_params), **options[:options])
  end

  head :ok
end