Class: CascadingConfiguration::Core::Module::ExtendedConfigurations
- Inherits:
-
CascadingConfiguration::Core::Module
- Object
- Module
- CascadingConfiguration::Core::Module
- CascadingConfiguration::Core::Module::ExtendedConfigurations
- Defined in:
- lib/cascading_configuration/core/module/extended_configurations.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CompositingObjects
Constant Summary
Constants inherited from CascadingConfiguration::Core::Module
DefaultEncapsulation, DefaultEncapsulationName
Instance Attribute Summary
Attributes inherited from CascadingConfiguration::Core::Module
#ccm_aliases, #ccm_name, #default_encapsulation
Class Method Summary collapse
-
.parse_extension_modules(instance_controller, encapsulation, *names_modules) ⇒ Object
self.parse_extension_modules #.
Instance Method Summary collapse
-
#define_configurations(instance_controller, encapsulation, method_types, *names_modules, &definer_block) ⇒ Object
define_configurations #.
Methods inherited from CascadingConfiguration::Core::Module
#create_configuration, #define_cascading_definition_method, #define_definition_methods, #define_instance_definition_method, #define_local_instance_definition_method, #define_module_definition_method, #define_object_definition_method, #initialize, #initialize_configuration
Methods included from EnableModuleSupport
Constructor Details
This class inherits a constructor from CascadingConfiguration::Core::Module
Class Method Details
.parse_extension_modules(instance_controller, encapsulation, *names_modules) ⇒ Object
self.parse_extension_modules #
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cascading_configuration/core/module/extended_configurations.rb', line 8 def self.parse_extension_modules( instance_controller, encapsulation, *names_modules ) # We can have configuration names or modules - we need to separate them. names = [ ] modules = [ ] names_modules.each do |this_name_or_module| case this_name_or_module when ::Class raise ArgumentError, 'Module expected (received Class).' when ::Module modules.push( this_name_or_module ) else names.push( this_name_or_module ) end end names_modules_hash = { } # if we have a block to define extensions to the compositing object: names.each do |this_name| names_modules_hash[ this_name ] = modules end return names_modules_hash end |
Instance Method Details
#define_configurations(instance_controller, encapsulation, method_types, *names_modules, &definer_block) ⇒ Object
define_configurations #
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cascading_configuration/core/module/extended_configurations.rb', line 50 def define_configurations( instance_controller, encapsulation, method_types, *names_modules, & definer_block ) # Ask MethodModule to parse extension modules for these declarations on instance. names_modules_hash = self.class.parse_extension_modules( instance_controller, encapsulation, *names_modules ) names_modules_hash.each do |this_name, these_modules| instance_controller.add_extension_modules( this_name, encapsulation, *these_modules, & definer_block ) end names = names_modules_hash.keys super( instance_controller, encapsulation, method_types, *names, & definer_block ) end |