File: webhook.rb

package info (click to toggle)
ruby-noticed 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: ruby: 1,186; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Noticed
  module BulkDeliveryMethods
    class Webhook < BulkDeliveryMethod
      required_options :url

      def deliver
        Rails.logger.debug(evaluate_option(:json))
        post_request(
          evaluate_option(:url),
          basic_auth: evaluate_option(:basic_auth),
          headers: evaluate_option(:headers),
          json: evaluate_option(:json),
          form: evaluate_option(:form),
          body: evaluate_option(:body)
        )
      end
    end
  end
end

ActiveSupport.run_load_hooks :noticed_bulk_delivery_methods_webhook, Noticed::BulkDeliveryMethods::Webhook