Class: Adcloud::WebhookConfig

Inherits:
ActiveSupport::Configurable::Configuration
  • Object
show all
Defined in:
lib/adcloud/webhook_config.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWebhookConfig

Returns a new instance of WebhookConfig.



3
4
5
6
7
8
# File 'lib/adcloud/webhook_config.rb', line 3

def initialize
  Adcloud::Webhook::ALL.each do |hook|
    self.send("#{hook}=", WebhookConfig.method(:unused_webhook))
  end
  self.on_unknown_webhook = WebhookConfig.method(:unknown_webhook)
end

Class Method Details

.unknown_webhook(event) ⇒ Object



14
15
16
# File 'lib/adcloud/webhook_config.rb', line 14

def self.unknown_webhook(event)
  Adcloud.logger.warn { "Unknown webhook event #{event.inspect}. Please contact gem maintainer!" }
end

.unused_webhook(event) ⇒ Object



10
11
12
# File 'lib/adcloud/webhook_config.rb', line 10

def self.unused_webhook(event)
  Adcloud.logger.warn { "Webhook behaviour missing for #{event.inspect}" }
end