summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-11 11:27:23 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-12 09:38:00 +0200
commitb80e888e11f9c976053ec5aa4a7f8e7c6d3227b3 (patch)
tree3f20a1e4a3a4e377b57b9ad8b5e819924c8a0f37
parent831fbca253ad01a4c9f38f18fed2afba4dc8226f (diff)
downloadedoors-ruby-b80e888e11f9c976053ec5aa4a7f8e7c6d3227b3.zip
edoors-ruby-b80e888e11f9c976053ec5aa4a7f8e7c6d3227b3.tar.gz
Spin: clear! must clean @spots too, set self as parent of create sub entities
-rw-r--r--lib/evendoors/spin.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/evendoors/spin.rb b/lib/evendoors/spin.rb
index 2ba63a4..1316c82 100644
--- a/lib/evendoors/spin.rb
+++ b/lib/evendoors/spin.rb
@@ -36,12 +36,15 @@ module EvenDoors
#
if not o.empty?
o['spots'].each do |name,spot|
- add_spot EvenDoors::Room.json_create spot
+ spot['parent']=self
+ EvenDoors::Room.json_create(spot)
end if o['spots']
o['app_fifo'].each do |particle|
+ particle['parent']=self
@app_fifo << EvenDoors::Particle.json_create(particle)
end if o['app_fifo']
o['sys_fifo'].each do |particle|
+ particle['parent']=self
@sys_fifo << EvenDoors::Particle.json_create(particle)
end if o['sys_fifo']
end
@@ -67,6 +70,7 @@ module EvenDoors
end
#
def clear!
+ @spots.clear
@pool.clear
@sys_fifo.clear
@app_fifo.clear