From b80e888e11f9c976053ec5aa4a7f8e7c6d3227b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 11 May 2012 11:27:23 +0200 Subject: Spin: clear! must clean @spots too, set self as parent of create sub entities --- lib/evendoors/spin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.1-2-g2b99