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
|