Class: WebhookSystem::Job

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/webhook_system/job.rb

Overview

This is the ActiveJob in charge of actually sending each event

Instance Method Summary collapse

Instance Method Details

#perform(subscription, event) ⇒ Object



6
7
8
9
10
# File 'lib/webhook_system/job.rb', line 6

def perform(subscription, event)
  payload = Encoder.encode(subscription.secret, event)
  client = HttpClient.new(subscription.url)
  client.post(payload)
end