Class: CascadingConfiguration::Core::Module::InheritingValues
- Inherits:
-
CascadingConfiguration::Core::Module
- Object
- Module
- CascadingConfiguration::Core::Module
- CascadingConfiguration::Core::Module::InheritingValues
- Defined in:
- lib/cascading_configuration/core/module/inheriting_values.rb
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
Instance Method Summary collapse
-
#get_configuration_searching_upward(encapsulation, instance, configuration_name) ⇒ Object
get_configuration_searching_upward #.
-
#getter(encapsulation, instance, name) ⇒ Object
(also: #instance_getter)
getter #.
-
#setter(encapsulation, instance, name, value) ⇒ Object
(also: #instance_setter)
setter #.
Methods inherited from CascadingConfiguration::Core::Module
#create_configuration, #define_cascading_definition_method, #define_configurations, #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
Instance Method Details
#get_configuration_searching_upward(encapsulation, instance, configuration_name) ⇒ Object
get_configuration_searching_upward #
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cascading_configuration/core/module/inheriting_values.rb', line 40 def get_configuration_searching_upward( encapsulation, instance, configuration_name ) configuration_value = nil matching_ancestor = nil did_match_ancestor = false matching_ancestor = encapsulation.match_parent( instance, configuration_name ) do |this_ancestor| if encapsulation.has_configuration_value?( this_ancestor, configuration_name ) did_match_ancestor = true else false end end if did_match_ancestor configuration_value = encapsulation.get_configuration( matching_ancestor, configuration_name ) end return configuration_value end |
#getter(encapsulation, instance, name) ⇒ Object Also known as: instance_getter
getter #
18 19 20 21 22 |
# File 'lib/cascading_configuration/core/module/inheriting_values.rb', line 18 def getter( encapsulation, instance, name ) return get_configuration_searching_upward( encapsulation, instance, name ) end |
#setter(encapsulation, instance, name, value) ⇒ Object Also known as: instance_setter
setter #
8 9 10 11 12 |
# File 'lib/cascading_configuration/core/module/inheriting_values.rb', line 8 def setter( encapsulation, instance, name, value ) return encapsulation.set_configuration( instance, name, value ) end |