cascading-configuration-array 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,6 @@ end
27
27
  require_relative 'cascading-configuration-array/CascadingConfiguration/CompositingArray.rb'
28
28
  require_relative 'cascading-configuration-array/CascadingConfiguration/_private_/CompositingArray.rb'
29
29
  require_relative 'cascading-configuration-array/CascadingConfiguration/CompositingArray/Instance.rb'
30
- require_relative 'cascading-configuration-array/CascadingConfiguration/CompositingArray/_private_/Instance.rb'
31
30
  require_relative 'cascading-configuration-array/CascadingConfiguration/LocalConfigurationArray.rb'
32
31
  require_relative 'cascading-configuration-array/CascadingConfiguration/_private_/LocalConfigurationArray.rb'
33
32
  require_relative 'cascading-configuration-array/CascadingConfiguration/Array.rb'
@@ -18,17 +18,17 @@ module CascadingConfiguration::CompositingArray::Instance
18
18
 
19
19
  def composite_array_for_cascading_configuration( cascading_name )
20
20
 
21
- # initialize composite array if necessary or acquire it from object
22
- composite_array_variable = composite_array_variable_name( cascading_name )
23
-
24
21
  composite_array = nil
25
22
 
26
- if instance_variable_defined?( composite_array_variable )
27
- composite_array = instance_variable_get( composite_array_variable )
28
- else
29
- composite_array = ::CascadingConfiguration::CompositingArray.new( cascading_name, self )
30
- instance_variable_set( composite_array_variable, composite_array )
31
- end
23
+ klass = ( is_a?( Module ) ? self : self.class )
24
+ accessor_support_module = klass::AccessorSupportModule
25
+ self_instance = self
26
+ accessor_support_module.instance_eval do
27
+ unless composite_array = ( ( @composite_arrays ||= Hash.new )[ cascading_name ] ||= Hash.new )[ self_instance ]
28
+ composite_array = ::CascadingConfiguration::CompositingArray.new( cascading_name, self_instance )
29
+ @composite_arrays[ cascading_name ][ self_instance ] = composite_array
30
+ end
31
+ end
32
32
 
33
33
  return composite_array
34
34
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Asher
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-07-15 00:00:00 -04:00
17
+ date: 2011-07-16 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -45,7 +45,6 @@ files:
45
45
  - lib/cascading-configuration-array/CascadingConfiguration/Array/ClassInstance.rb
46
46
  - lib/cascading-configuration-array/CascadingConfiguration/Array/ModuleInstance.rb
47
47
  - lib/cascading-configuration-array/CascadingConfiguration/Array.rb
48
- - lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/_private_/Instance.rb
49
48
  - lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/Instance.rb
50
49
  - lib/cascading-configuration-array/CascadingConfiguration/CompositingArray.rb
51
50
  - lib/cascading-configuration-array/CascadingConfiguration/LocalConfigurationArray.rb
@@ -1,17 +0,0 @@
1
-
2
- module CascadingConfiguration::CompositingArray::Instance
3
-
4
- ###########################################################################################################
5
- private ###############################################################################################
6
- ###########################################################################################################
7
-
8
- ###################################
9
- # composite_array_variable_name #
10
- ###################################
11
-
12
- def composite_array_variable_name( configuration_name )
13
- klass = ( is_a?( Module ) ? self : self.class )
14
- return ( klass::AccessorSupportModule.cascading_variable_name( configuration_name ).to_s + '__' + 'compositing_array' ).to_sym
15
- end
16
-
17
- end