Revision 428fdd46
Added by Marc Dequènes almost 15 years ago
- ID 428fdd46a8f2ab849d47b17123cf6413d6cbfacc
lib/ldap_shadows/shadow.rb | ||
---|---|---|
raise PreProcessingError, _("Element '%s' for model '%s' as already been defined") % [e_name, e_type]
|
||
end
|
||
|
||
e_def = @config.parse(e_name, e_type, e_def_raw)
|
||
e_default_parameters = @config.load_default_config(e_type)
|
||
e_def = @config.parse(e_name, e_type, e_def_raw, true, {:default_parameters => e_default_parameters})
|
||
e_config = e_default_parameters.recursive_merge(e_def)
|
||
|
||
klass = @container.module_eval(<<-EOS)
|
||
... | ... | |
klass.instance_variable_set(:@handle, e_name)
|
||
klass.instance_variable_set(:@shadow, self)
|
||
klass.instance_variable_set(:@config, @config)
|
||
klass.instance_variable_set(:@default_parameters, e_default_parameters)
|
||
klass.instance_variable_set(:@parameters, e_config)
|
||
klass.meta_eval do
|
||
attr_reader :handle, :shadow, :config, :parameters
|
||
attr_reader :handle, :shadow, :config, :default_parameters, :parameters
|
||
end
|
||
|
||
begin
|
||
... | ... | |
|
||
klass
|
||
rescue
|
||
raise PreProcessingError, _("Could not create element '%s' for model '%s': %s") % [e_type, e_name, $!]
|
||
raise PreProcessingError, _("Could not create element '%s' for model '%s': %s") % [e_name, e_type, $!]
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
[cleanup] reorganized config