scinote-web/app/services/activities/activity_webhook_service.rb

22 lines
430 B
Ruby
Raw Normal View History

2021-06-17 20:54:30 +08:00
# frozen_string_literal: true
module Activities
class ActivityWebhookService
def initialize(webhook, activity)
@webhook = webhook
@activity = activity
end
def send_webhook
WebhookService.new(@webhook, activity_payload).send_webhook
end
def activity_payload
@activity.values.merge(
type: @activity.type_of,
created_at: @activity.created_at
)
end
end
end