Class: ForemanWebhooks::DeliverWebhookJob
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- ForemanWebhooks::DeliverWebhookJob
- Defined in:
- app/jobs/foreman_webhooks/deliver_webhook_job.rb
Instance Method Summary collapse
Instance Method Details
#humanized_name ⇒ Object
22 23 24 25 |
# File 'app/jobs/foreman_webhooks/deliver_webhook_job.rb', line 22 def humanized_name webhook = webhook_id && Webhook.unscoped.find_by(id: webhook_id) (webhook && (_('Deliver webhook %s') % webhook.name)) || _('Deliver webhook') end |
#perform(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/jobs/foreman_webhooks/deliver_webhook_job.rb', line 7 def perform() webhook = Webhook.unscoped.find_by(id: [:webhook_id]) WebhookService.new( webhook: webhook, headers: [:headers], url: [:url], event_name: [:event_name], payload: [:payload] ).execute end |
#webhook_id ⇒ Object
18 19 20 |
# File 'app/jobs/foreman_webhooks/deliver_webhook_job.rb', line 18 def webhook_id arguments.first['webhook_id'] unless arguments.first.nil? end |