cascading-configuration-hash 2.0.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cascading-configuration-hash.rb +1 -4
- data/lib/cascading-configuration-hash/CascadingConfiguration/Hash.rb +1 -1
- data/lib/cascading-configuration-hash/CascadingConfiguration/Hash/Interface.rb +64 -41
- data/lib/cascading-configuration-hash/_private_/CascadingConfiguration/Hash/ModuleSupportMethods.rb +1 -1
- data/spec/CascadingConfiguration/Hash_spec.rb +14 -14
- data/spec/_private_/CascadingConfiguration/Hash/CompositingHash_spec.rb +2 -2
- metadata +4 -16
- data/lib/cascading-configuration-hash/_private_/CascadingConfiguration/Hash/Interface/GettersSetters.rb +0 -176
@@ -5,19 +5,16 @@ else
|
|
5
5
|
require 'cascading-configuration-variable'
|
6
6
|
end
|
7
7
|
|
8
|
-
module CascadingConfiguration
|
8
|
+
module ::CascadingConfiguration
|
9
9
|
module Hash
|
10
10
|
class CompositingHash < ::Hash
|
11
11
|
end
|
12
12
|
module Interface
|
13
|
-
module GettersSetters
|
14
|
-
end
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
19
17
|
require_relative 'cascading-configuration-hash/_private_/CascadingConfiguration/Hash/CompositingHash.rb'
|
20
|
-
require_relative 'cascading-configuration-hash/_private_/CascadingConfiguration/Hash/Interface/GettersSetters.rb'
|
21
18
|
require_relative 'cascading-configuration-hash/_private_/CascadingConfiguration/Hash/ModuleSupportMethods.rb'
|
22
19
|
|
23
20
|
require_relative 'cascading-configuration-hash/CascadingConfiguration/Hash/Interface.rb'
|
@@ -1,8 +1,36 @@
|
|
1
1
|
|
2
|
-
module CascadingConfiguration::Hash::Interface
|
2
|
+
module ::CascadingConfiguration::Hash::Interface
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
######################
|
5
|
+
# self.setter_proc #
|
6
|
+
######################
|
7
|
+
|
8
|
+
def self.setter_proc( configuration_name )
|
9
|
+
|
10
|
+
return Proc.new do |hash|
|
11
|
+
|
12
|
+
return ::CascadingConfiguration::Hash.
|
13
|
+
composite_hash_for_cascading_configuration( self,
|
14
|
+
configuration_name ).replace( hash )
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
######################
|
21
|
+
# self.getter_proc #
|
22
|
+
######################
|
23
|
+
|
24
|
+
def self.getter_proc( configuration_name )
|
25
|
+
|
26
|
+
return Proc.new do
|
27
|
+
|
28
|
+
return ::CascadingConfiguration::Hash.
|
29
|
+
composite_hash_for_cascading_configuration( self, configuration_name )
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
6
34
|
|
7
35
|
#############################
|
8
36
|
# attr_configuration_hash #
|
@@ -15,16 +43,15 @@ module CascadingConfiguration::Hash::Interface
|
|
15
43
|
configuration_names.each do |this_configuration_name|
|
16
44
|
if block_given?
|
17
45
|
::CascadingConfiguration::Variable.set_compositing_proc( self,
|
18
|
-
|
19
|
-
|
46
|
+
this_configuration_name,
|
47
|
+
compositing_block )
|
20
48
|
end
|
21
|
-
# define configuration setter
|
22
|
-
define_cascading_hash_setter( this_configuration_name )
|
23
|
-
# define configuration getter
|
24
|
-
define_cascading_hash_getter( this_configuration_name )
|
25
49
|
end
|
26
|
-
|
27
|
-
return
|
50
|
+
|
51
|
+
return ::CascadingConfiguration::Variable.
|
52
|
+
define_cascading_configuration( self,
|
53
|
+
::CascadingConfiguration::Hash::Interface,
|
54
|
+
*configuration_names )
|
28
55
|
|
29
56
|
end
|
30
57
|
|
@@ -39,16 +66,15 @@ module CascadingConfiguration::Hash::Interface
|
|
39
66
|
configuration_names.each do |this_configuration_name|
|
40
67
|
if block_given?
|
41
68
|
::CascadingConfiguration::Variable.set_compositing_proc( self,
|
42
|
-
|
43
|
-
|
69
|
+
this_configuration_name,
|
70
|
+
compositing_block )
|
44
71
|
end
|
45
|
-
# define configuration setter
|
46
|
-
define_class_configuration_hash_setter( this_configuration_name )
|
47
|
-
# define configuration getter
|
48
|
-
define_class_configuration_hash_getter( this_configuration_name )
|
49
72
|
end
|
50
|
-
|
51
|
-
return
|
73
|
+
|
74
|
+
return ::CascadingConfiguration::Variable.
|
75
|
+
define_module_configuration( self,
|
76
|
+
::CascadingConfiguration::Hash::Interface,
|
77
|
+
*configuration_names )
|
52
78
|
|
53
79
|
end
|
54
80
|
alias_method :attr_class_configuration_hash, :attr_module_configuration_hash
|
@@ -66,16 +92,15 @@ module CascadingConfiguration::Hash::Interface
|
|
66
92
|
configuration_names.each do |this_configuration_name|
|
67
93
|
if block_given?
|
68
94
|
::CascadingConfiguration::Variable.set_compositing_proc( self,
|
69
|
-
|
70
|
-
|
95
|
+
this_configuration_name,
|
96
|
+
compositing_block )
|
71
97
|
end
|
72
|
-
# define configuration setter
|
73
|
-
define_local_configuration_hash_setter( this_configuration_name )
|
74
|
-
# define configuration getter
|
75
|
-
define_local_configuration_hash_getter( this_configuration_name )
|
76
98
|
end
|
77
|
-
|
78
|
-
return
|
99
|
+
|
100
|
+
return ::CascadingConfiguration::Variable.
|
101
|
+
define_local_configuration( self,
|
102
|
+
::CascadingConfiguration::Hash::Interface,
|
103
|
+
*configuration_names )
|
79
104
|
|
80
105
|
end
|
81
106
|
|
@@ -92,16 +117,15 @@ module CascadingConfiguration::Hash::Interface
|
|
92
117
|
configuration_names.each do |this_configuration_name|
|
93
118
|
if block_given?
|
94
119
|
::CascadingConfiguration::Variable.set_compositing_proc( self,
|
95
|
-
|
96
|
-
|
120
|
+
this_configuration_name,
|
121
|
+
compositing_block )
|
97
122
|
end
|
98
|
-
# define configuration setter
|
99
|
-
define_object_configuration_hash_setter( this_configuration_name )
|
100
|
-
# define configuration getter
|
101
|
-
define_object_configuration_hash_getter( this_configuration_name )
|
102
123
|
end
|
103
124
|
|
104
|
-
return
|
125
|
+
return ::CascadingConfiguration::Variable.
|
126
|
+
define_object_configuration( self,
|
127
|
+
::CascadingConfiguration::Hash::Interface,
|
128
|
+
*configuration_names )
|
105
129
|
|
106
130
|
end
|
107
131
|
|
@@ -116,16 +140,15 @@ module CascadingConfiguration::Hash::Interface
|
|
116
140
|
configuration_names.each do |this_configuration_name|
|
117
141
|
if block_given?
|
118
142
|
::CascadingConfiguration::Variable.set_compositing_proc( self,
|
119
|
-
|
120
|
-
|
143
|
+
this_configuration_name,
|
144
|
+
compositing_block )
|
121
145
|
end
|
122
|
-
# define configuration setter
|
123
|
-
define_instance_configuration_hash_setter( this_configuration_name )
|
124
|
-
# define configuration getter
|
125
|
-
define_instance_configuration_hash_getter( this_configuration_name )
|
126
146
|
end
|
127
147
|
|
128
|
-
return
|
148
|
+
return ::CascadingConfiguration::Variable.
|
149
|
+
define_instance_configuration( self,
|
150
|
+
::CascadingConfiguration::Hash::Interface,
|
151
|
+
*configuration_names )
|
129
152
|
|
130
153
|
end
|
131
154
|
|
@@ -25,7 +25,7 @@ describe CascadingConfiguration::Hash do
|
|
25
25
|
# => instances of including classes get configurations
|
26
26
|
# => extending modules and classes get attr_configuration and configurations
|
27
27
|
# => instances of extending classes get nothing
|
28
|
-
module CascadingConfiguration::Hash::ConfigurationMockModuleExtended
|
28
|
+
module ::CascadingConfiguration::Hash::ConfigurationMockModuleExtended
|
29
29
|
extend CascadingConfiguration::Hash
|
30
30
|
# => singleton gets attr_configuration and configurations
|
31
31
|
respond_to?( :attr_configuration_hash ).should == true
|
@@ -66,7 +66,7 @@ describe CascadingConfiguration::Hash do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
# * module included with setting
|
69
|
-
module CascadingConfiguration::Hash::ConfigurationMockModuleIncluded
|
69
|
+
module ::CascadingConfiguration::Hash::ConfigurationMockModuleIncluded
|
70
70
|
include CascadingConfiguration::Hash
|
71
71
|
# => singleton gets attr_configuration and configurations
|
72
72
|
respond_to?( :attr_configuration_hash ).should == true
|
@@ -214,7 +214,7 @@ describe CascadingConfiguration::Hash do
|
|
214
214
|
:another_configuration => :some_value,
|
215
215
|
:some_other_configuration => :some_value }
|
216
216
|
|
217
|
-
module CascadingConfiguration::Hash::ConfigurationMockModule
|
217
|
+
module ::CascadingConfiguration::Hash::ConfigurationMockModule
|
218
218
|
include CascadingConfiguration::Hash
|
219
219
|
attr_configuration_hash :some_hash do |hash, key, foreign_value|
|
220
220
|
if existing_value = hash[ key ]
|
@@ -227,7 +227,7 @@ describe CascadingConfiguration::Hash do
|
|
227
227
|
self.some_hash.should == { :one => 1, :two => 2 }
|
228
228
|
end
|
229
229
|
|
230
|
-
module CascadingConfiguration::Hash::ConfigurationMockModule2
|
230
|
+
module ::CascadingConfiguration::Hash::ConfigurationMockModule2
|
231
231
|
include CascadingConfiguration::Hash::ConfigurationMockModule
|
232
232
|
self.some_hash.should == { :one => 1, :two => 2 }
|
233
233
|
self.some_hash.merge!( { :one => 1, :two => 2 } )
|
@@ -255,7 +255,7 @@ describe CascadingConfiguration::Hash do
|
|
255
255
|
# => instances of including classes get configurations
|
256
256
|
# => extending modules and classes get attr_configuration and configurations
|
257
257
|
# => instances of extending classes get nothing
|
258
|
-
module CascadingConfiguration::Hash::ClassConfigurationMockModuleExtended
|
258
|
+
module ::CascadingConfiguration::Hash::ClassConfigurationMockModuleExtended
|
259
259
|
extend CascadingConfiguration::Hash
|
260
260
|
# => singleton gets attr_configuration and configurations
|
261
261
|
respond_to?( :attr_module_configuration_hash ).should == true
|
@@ -297,7 +297,7 @@ describe CascadingConfiguration::Hash do
|
|
297
297
|
end
|
298
298
|
|
299
299
|
# * module included with setting
|
300
|
-
module CascadingConfiguration::Hash::ClassConfigurationMockModuleIncluded
|
300
|
+
module ::CascadingConfiguration::Hash::ClassConfigurationMockModuleIncluded
|
301
301
|
include CascadingConfiguration::Hash
|
302
302
|
# => singleton gets attr_configuration and configurations
|
303
303
|
respond_to?( :attr_module_configuration_hash ).should == true
|
@@ -421,7 +421,7 @@ describe CascadingConfiguration::Hash do
|
|
421
421
|
:a_yet_unused_configuration => :some_value,
|
422
422
|
:another_configuration => :some_value }
|
423
423
|
|
424
|
-
module CascadingConfiguration::Hash::ClassConfigurationMockModule
|
424
|
+
module ::CascadingConfiguration::Hash::ClassConfigurationMockModule
|
425
425
|
include CascadingConfiguration::Hash
|
426
426
|
attr_configuration_hash :some_hash do |hash, key, foreign_value|
|
427
427
|
if existing_value = hash[ key ]
|
@@ -434,7 +434,7 @@ describe CascadingConfiguration::Hash do
|
|
434
434
|
self.some_hash.should == { :one => 1, :two => 2 }
|
435
435
|
end
|
436
436
|
|
437
|
-
module CascadingConfiguration::Hash::ClassConfigurationMockModule2
|
437
|
+
module ::CascadingConfiguration::Hash::ClassConfigurationMockModule2
|
438
438
|
include CascadingConfiguration::Hash::ClassConfigurationMockModule
|
439
439
|
self.some_hash.should == { :one => 1, :two => 2 }
|
440
440
|
self.some_hash.merge!( { :one => 1, :two => 2 } )
|
@@ -461,7 +461,7 @@ describe CascadingConfiguration::Hash do
|
|
461
461
|
# => instances of including classes get configurations
|
462
462
|
# => extending modules and classes get attr_configuration and configurations
|
463
463
|
# => instances of extending classes get nothing
|
464
|
-
module CascadingConfiguration::Hash::LocalConfigurationMockModuleExtended
|
464
|
+
module ::CascadingConfiguration::Hash::LocalConfigurationMockModuleExtended
|
465
465
|
extend CascadingConfiguration::Hash
|
466
466
|
# => singleton gets attr_configuration and configurations
|
467
467
|
respond_to?( :attr_local_configuration_hash ).should == true
|
@@ -502,7 +502,7 @@ describe CascadingConfiguration::Hash do
|
|
502
502
|
end
|
503
503
|
|
504
504
|
# * module included with setting
|
505
|
-
module CascadingConfiguration::Hash::LocalConfigurationMockModuleIncluded
|
505
|
+
module ::CascadingConfiguration::Hash::LocalConfigurationMockModuleIncluded
|
506
506
|
include CascadingConfiguration::Hash
|
507
507
|
# => singleton gets attr_configuration and configurations
|
508
508
|
respond_to?( :attr_local_configuration_hash ).should == true
|
@@ -592,7 +592,7 @@ describe CascadingConfiguration::Hash do
|
|
592
592
|
# => instances of including classes get configurations
|
593
593
|
# => extending modules and classes get attr_configuration and configurations
|
594
594
|
# => instances of extending classes get nothing
|
595
|
-
module CascadingConfiguration::Hash::InstanceConfigurationMockModuleExtended
|
595
|
+
module ::CascadingConfiguration::Hash::InstanceConfigurationMockModuleExtended
|
596
596
|
extend CascadingConfiguration::Hash
|
597
597
|
# => singleton gets attr_configuration and configurations
|
598
598
|
instance_methods.include?( :configuration_setting ).should == false
|
@@ -627,7 +627,7 @@ describe CascadingConfiguration::Hash do
|
|
627
627
|
end
|
628
628
|
|
629
629
|
# * module included with setting
|
630
|
-
module CascadingConfiguration::Hash::InstanceConfigurationMockModuleIncluded
|
630
|
+
module ::CascadingConfiguration::Hash::InstanceConfigurationMockModuleIncluded
|
631
631
|
include CascadingConfiguration::Hash
|
632
632
|
# => singleton gets attr_configuration and configurations
|
633
633
|
respond_to?( :attr_instance_configuration_hash ).should == true
|
@@ -714,7 +714,7 @@ describe CascadingConfiguration::Hash do
|
|
714
714
|
# => instances of including classes get configurations
|
715
715
|
# => extending modules and classes get attr_configuration and configurations
|
716
716
|
# => instances of extending classes get nothing
|
717
|
-
module CascadingConfiguration::Hash::ObjectConfigurationMockModuleExtended
|
717
|
+
module ::CascadingConfiguration::Hash::ObjectConfigurationMockModuleExtended
|
718
718
|
extend CascadingConfiguration::Hash
|
719
719
|
# => singleton gets attr_configuration and configurations
|
720
720
|
respond_to?( :attr_object_configuration_hash ).should == true
|
@@ -755,7 +755,7 @@ describe CascadingConfiguration::Hash do
|
|
755
755
|
end
|
756
756
|
|
757
757
|
# * module included with setting
|
758
|
-
module CascadingConfiguration::Hash::ObjectConfigurationMockModuleIncluded
|
758
|
+
module ::CascadingConfiguration::Hash::ObjectConfigurationMockModuleIncluded
|
759
759
|
include CascadingConfiguration::Hash
|
760
760
|
# => singleton gets attr_configuration and configurations
|
761
761
|
respond_to?( :attr_object_configuration_hash ).should == true
|
@@ -9,12 +9,12 @@ describe CascadingConfiguration::Hash::CompositingHash do
|
|
9
9
|
|
10
10
|
before :all do
|
11
11
|
|
12
|
-
module CascadingConfiguration::Hash::CompositingHash::MockA
|
12
|
+
module ::CascadingConfiguration::Hash::CompositingHash::MockA
|
13
13
|
# needed for ccv ancestor determination
|
14
14
|
def self.some_configuration
|
15
15
|
end
|
16
16
|
end
|
17
|
-
module CascadingConfiguration::Hash::CompositingHash::MockB
|
17
|
+
module ::CascadingConfiguration::Hash::CompositingHash::MockB
|
18
18
|
end
|
19
19
|
|
20
20
|
@configuration_instance = CascadingConfiguration::Hash::CompositingHash::MockA
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cascading-configuration-hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: module-cluster
|
16
|
-
requirement: &70242260848920 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70242260848920
|
25
14
|
- !ruby/object:Gem::Dependency
|
26
15
|
name: cascading-configuration-variable
|
27
|
-
requirement: &
|
16
|
+
requirement: &70317490911220 !ruby/object:Gem::Requirement
|
28
17
|
none: false
|
29
18
|
requirements:
|
30
19
|
- - ! '>='
|
@@ -32,7 +21,7 @@ dependencies:
|
|
32
21
|
version: '0'
|
33
22
|
type: :runtime
|
34
23
|
prerelease: false
|
35
|
-
version_requirements: *
|
24
|
+
version_requirements: *70317490911220
|
36
25
|
description: Provides :attr_configuration_hash.
|
37
26
|
email: asher@ridiculouspower.com
|
38
27
|
executables: []
|
@@ -40,7 +29,6 @@ extensions: []
|
|
40
29
|
extra_rdoc_files: []
|
41
30
|
files:
|
42
31
|
- lib/cascading-configuration-hash/_private_/CascadingConfiguration/Hash/CompositingHash.rb
|
43
|
-
- lib/cascading-configuration-hash/_private_/CascadingConfiguration/Hash/Interface/GettersSetters.rb
|
44
32
|
- lib/cascading-configuration-hash/_private_/CascadingConfiguration/Hash/ModuleSupportMethods.rb
|
45
33
|
- lib/cascading-configuration-hash/CascadingConfiguration/Hash/Interface.rb
|
46
34
|
- lib/cascading-configuration-hash/CascadingConfiguration/Hash.rb
|
@@ -1,176 +0,0 @@
|
|
1
|
-
|
2
|
-
module CascadingConfiguration::Hash::Interface::GettersSetters
|
3
|
-
|
4
|
-
##################################
|
5
|
-
# define_cascading_hash_setter #
|
6
|
-
##################################
|
7
|
-
|
8
|
-
def define_cascading_hash_setter( configuration_name )
|
9
|
-
|
10
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
11
|
-
|
12
|
-
hash_setter_proc = Proc.new do |hash|
|
13
|
-
|
14
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name ).replace( hash )
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
::CascadingConfiguration::Variable.define_module_method( self, configuration_setter_name, & hash_setter_proc )
|
19
|
-
::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_setter_name, & hash_setter_proc )
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
##################################
|
24
|
-
# define_cascading_hash_getter #
|
25
|
-
##################################
|
26
|
-
|
27
|
-
def define_cascading_hash_getter( configuration_name )
|
28
|
-
|
29
|
-
configuration_getter_name = configuration_name
|
30
|
-
|
31
|
-
hash_getter_proc = Proc.new do
|
32
|
-
|
33
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name )
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name, & hash_getter_proc )
|
38
|
-
::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_getter_name, & hash_getter_proc )
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
############################################
|
43
|
-
# define_class_configuration_hash_setter #
|
44
|
-
############################################
|
45
|
-
|
46
|
-
def define_class_configuration_hash_setter( configuration_name )
|
47
|
-
|
48
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
49
|
-
|
50
|
-
::CascadingConfiguration::Variable.define_module_method( self, configuration_setter_name ) do |hash|
|
51
|
-
|
52
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name ).replace( hash )
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
############################################
|
59
|
-
# define_class_configuration_hash_getter #
|
60
|
-
############################################
|
61
|
-
|
62
|
-
def define_class_configuration_hash_getter( configuration_name )
|
63
|
-
|
64
|
-
configuration_getter_name = configuration_name
|
65
|
-
|
66
|
-
::CascadingConfiguration::Variable.define_module_method( self, configuration_getter_name ) do
|
67
|
-
|
68
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name )
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
############################################
|
75
|
-
# define_local_configuration_hash_setter #
|
76
|
-
############################################
|
77
|
-
|
78
|
-
def define_local_configuration_hash_setter( configuration_name )
|
79
|
-
|
80
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
81
|
-
|
82
|
-
local_setter_proc = Proc.new do |hash|
|
83
|
-
|
84
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name ).replace( hash )
|
85
|
-
|
86
|
-
end
|
87
|
-
|
88
|
-
::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_setter_name, & local_setter_proc )
|
89
|
-
::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_setter_name, & local_setter_proc )
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
############################################
|
94
|
-
# define_local_configuration_hash_getter #
|
95
|
-
############################################
|
96
|
-
|
97
|
-
def define_local_configuration_hash_getter( configuration_name )
|
98
|
-
|
99
|
-
configuration_getter_name = configuration_name
|
100
|
-
|
101
|
-
local_getter_proc = Proc.new do
|
102
|
-
|
103
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name )
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_getter_name, & local_getter_proc )
|
108
|
-
::CascadingConfiguration::Variable.define_instance_method_if_support_exists( self, configuration_getter_name, & local_getter_proc )
|
109
|
-
|
110
|
-
end
|
111
|
-
|
112
|
-
###############################################
|
113
|
-
# define_instance_configuration_hash_setter #
|
114
|
-
###############################################
|
115
|
-
|
116
|
-
def define_instance_configuration_hash_setter( configuration_name )
|
117
|
-
|
118
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
119
|
-
|
120
|
-
::CascadingConfiguration::Variable.define_instance_method( self, configuration_setter_name ) do |hash|
|
121
|
-
|
122
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name ).replace( hash )
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
end
|
127
|
-
|
128
|
-
###############################################
|
129
|
-
# define_instance_configuration_hash_getter #
|
130
|
-
###############################################
|
131
|
-
|
132
|
-
def define_instance_configuration_hash_getter( configuration_name )
|
133
|
-
|
134
|
-
configuration_getter_name = configuration_name
|
135
|
-
|
136
|
-
::CascadingConfiguration::Variable.define_instance_method( self, configuration_getter_name ) do
|
137
|
-
|
138
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name )
|
139
|
-
|
140
|
-
end
|
141
|
-
|
142
|
-
end
|
143
|
-
|
144
|
-
#############################################
|
145
|
-
# define_object_configuration_hash_setter #
|
146
|
-
#############################################
|
147
|
-
|
148
|
-
def define_object_configuration_hash_setter( configuration_name )
|
149
|
-
|
150
|
-
configuration_setter_name = ( configuration_name.to_s + '=' ).to_sym
|
151
|
-
|
152
|
-
::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_setter_name ) do |hash|
|
153
|
-
|
154
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name ).replace( hash )
|
155
|
-
|
156
|
-
end
|
157
|
-
|
158
|
-
end
|
159
|
-
|
160
|
-
#############################################
|
161
|
-
# define_object_configuration_hash_getter #
|
162
|
-
#############################################
|
163
|
-
|
164
|
-
def define_object_configuration_hash_getter( configuration_name )
|
165
|
-
|
166
|
-
configuration_getter_name = configuration_name
|
167
|
-
|
168
|
-
::CascadingConfiguration::Variable.define_local_instance_method( self, configuration_getter_name ) do
|
169
|
-
|
170
|
-
return ::CascadingConfiguration::Hash.composite_hash_for_cascading_configuration( self, configuration_name )
|
171
|
-
|
172
|
-
end
|
173
|
-
|
174
|
-
end
|
175
|
-
|
176
|
-
end
|