From a1ce57fbbe635c6ae2667e534d070b1ec9feb713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 11 May 2012 11:32:53 +0200 Subject: Spin: rewrite parent stuff --- lib/evendoors/spin.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/evendoors/spin.rb b/lib/evendoors/spin.rb index 1316c82..69d204d 100644 --- a/lib/evendoors/spin.rb +++ b/lib/evendoors/spin.rb @@ -35,17 +35,15 @@ module EvenDoors @debug_routing = o[:debug_routing]||o['debug_routing']||false # if not o.empty? + p ={'parent'=>self} o['spots'].each do |name,spot| - spot['parent']=self - EvenDoors::Room.json_create(spot) + EvenDoors::Room.json_create(spot.merge!(p)) end if o['spots'] o['app_fifo'].each do |particle| - particle['parent']=self - @app_fifo << EvenDoors::Particle.json_create(particle) + @app_fifo << EvenDoors::Particle.json_create(particle.merge!(p)) end if o['app_fifo'] o['sys_fifo'].each do |particle| - particle['parent']=self - @sys_fifo << EvenDoors::Particle.json_create(particle) + @sys_fifo << EvenDoors::Particle.json_create(particle.merge!(p)) end if o['sys_fifo'] end end -- cgit v1.1-2-g2b99