Class: ActionWebhook::DeliveryJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- ActionWebhook::DeliveryJob
- Defined in:
- lib/action_webhook/delivery_job.rb
Overview
Job responsible for delivering webhooks in the background
Instance Method Summary collapse
-
#perform(delivery_method, serialized_webhook) ⇒ Object
Performs the webhook delivery with the specified delivery method.
Instance Method Details
#perform(delivery_method, serialized_webhook) ⇒ Object
Performs the webhook delivery with the specified delivery method
12 13 14 15 16 17 18 19 20 |
# File 'lib/action_webhook/delivery_job.rb', line 12 def perform(delivery_method, serialized_webhook) # Reconstruct the webhook from serialized data webhook_class = serialized_webhook["webhook_class"].constantize webhook = webhook_class.new webhook.deserialize(serialized_webhook) # Invoke the specified delivery method webhook.send(delivery_method) end |