File: microsoft_teams.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 (17 lines) | stat: -rw-r--r-- 492 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Noticed
  module DeliveryMethods
    class MicrosoftTeams < DeliveryMethod
      required_options :json

      def deliver
        post_request url, headers: evaluate_option(:headers), json: evaluate_option(:json)
      end

      def url
        evaluate_option(:url) || Rails.application.credentials.dig(:microsoft_teams, :notification_url)
      end
    end
  end
end

ActiveSupport.run_load_hooks :noticed_delivery_methods_microsoft_teams, Noticed::DeliveryMethods::MicrosoftTeams