Sha256: 35599305732d6c910362d81358012ad78be5905a99452fe0c3ad17cdc9332bca
Contents?: true
Size: 895 Bytes
Versions: 11
Compression:
Stored size: 895 Bytes
Contents
module Notification class Api attr_accessor :notification_type def initialize(notification_type: ENV['NOTIFICATION_TYPE']) self.notification_type = notification_type end def send_backup_notification(result, date, database, backup_path) return if notification_type.nil? case notification_type when 'slack' Slack.new.backup_notification(result, date, database, backup_path) when 'webhook' Webhook.new.backup_notification(result, date, database, backup_path) end end def send_notification(message) return if notification_type.nil? case notification_type when 'slack' Slack.new.notify(message) when 'webhook' p 'webhook' end end end end
Version data entries
11 entries across 11 versions & 1 rubygems