Module: ActiveWebhook::Configuration::Base

Extended by:
ActiveSupport::Concern
Included in:
ActiveWebhook::Configuration, Delivery::Configuration, Formatting::Configuration, Models::Configuration, Queueing::Configuration, Verification::Configuration
Defined in:
lib/active_webhook/configuration.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/active_webhook/configuration.rb', line 17

def initialize
  (self.class.instance_variable_get(:@components) || []).each do |component_name|
    component = "#{self.class.name.deconstantize}::#{component_name.to_s.camelize}::Configuration"
    component = component.constantize.new
    instance_variable_set "@#{component_name}", component
  end

  (self.class.instance_variable_get(:@options) || []).each do |option, option_definition|
    send "#{option}=", option_definition[:default]
  end
end