hash-compositing 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -172,7 +172,7 @@ module ::Hash::Compositing::HashInterface
172
172
  ##########
173
173
 
174
174
  def each( *args, & block )
175
-
175
+
176
176
  load_parent_state
177
177
 
178
178
  super
@@ -202,7 +202,7 @@ module ::Hash::Compositing::HashInterface
202
202
  super
203
203
 
204
204
  end
205
-
205
+
206
206
  ########
207
207
  # [] #
208
208
  ########
@@ -212,7 +212,7 @@ module ::Hash::Compositing::HashInterface
212
212
  return_value = nil
213
213
 
214
214
  if @parent_key_lookup[ key ]
215
- return_value = lazy_set_parent_element_in_self( key, @parent_composite_object[ key ] )
215
+ return_value = lazy_set_parent_element_in_self( key )
216
216
  else
217
217
  return_value = super
218
218
  end
@@ -287,26 +287,29 @@ module ::Hash::Compositing::HashInterface
287
287
 
288
288
  ######################### Self-as-Sub Management for Parent Updates ############################
289
289
 
290
- ################################
290
+ #####################################
291
291
  # lazy_set_parent_element_in_self #
292
- ################################
292
+ #####################################
293
293
 
294
- def lazy_set_parent_element_in_self( key, object )
294
+ def lazy_set_parent_element_in_self( key, *optional_object )
295
+
296
+ object = nil
297
+
298
+ case optional_object.count
299
+ when 0
300
+ object = @parent_composite_object[ key ]
301
+ when 1
302
+ object = optional_object[ 0 ]
303
+ end
304
+
305
+ @parent_key_lookup.delete( key )
295
306
 
296
307
  unless @without_child_hooks
297
308
  object = child_pre_set_hook( key, object )
298
309
  end
299
310
 
300
- unless @without_hooks
301
- object = pre_set_hook( key, object )
302
- end
303
-
304
311
  non_cascading_store( key, object )
305
312
 
306
- unless @without_hooks
307
- object = post_set_hook( key, object )
308
- end
309
-
310
313
  unless @without_child_hooks
311
314
  object = child_post_set_hook( key, object )
312
315
  end
@@ -395,7 +398,7 @@ module ::Hash::Compositing::HashInterface
395
398
  #######################
396
399
 
397
400
  def load_parent_state
398
-
401
+
399
402
  @parent_key_lookup.each do |this_key, true_value|
400
403
  self[ this_key ]
401
404
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash-compositing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-06 00:00:00.000000000 Z
12
+ date: 2012-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hash-hooked
@@ -53,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ! '>='
55
55
  - !ruby/object:Gem::Version
56
- version: '0'
56
+ version: 1.9.1
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements: