diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-10 23:27:09 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-10 23:27:09 +0200 |
commit | 5fbda1780698b2470133672aea247cfd35ba3e85 (patch) | |
tree | 18583e4e339038f31a1ae45bf511dbec34b067f3 /lib/edoors/spin.rb | |
parent | 71fa3a07057f7ba1d2b27c0b3e98d71354b4a049 (diff) | |
download | edoors-ruby-5fbda1780698b2470133672aea247cfd35ba3e85.zip edoors-ruby-5fbda1780698b2470133672aea247cfd35ba3e85.tar.gz |
Spin: to_json stores iota and links into inner_room
This allows top iotas to be Doors and not only Rooms
Diffstat (limited to 'lib/edoors/spin.rb')
-rw-r--r-- | lib/edoors/spin.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/edoors/spin.rb b/lib/edoors/spin.rb index 9894409..9f62b47 100644 --- a/lib/edoors/spin.rb +++ b/lib/edoors/spin.rb @@ -38,9 +38,17 @@ module Edoors @debug_routing = o[:debug_routing]||o['debug_routing']||false # if not o.empty? - o['iotas'].each do |name,iota| - Edoors::Room.json_create(iota.merge!('parent'=>self)) - end if o['iotas'] + room = o['inner_room'] + if room + room['iotas'].each do |name,iota| + eval( iota['kls'] ).json_create(iota.merge!('parent'=>self)) + end + room['links'].each do |src,links| + links.each do |link| + add_link Edoors::Link.json_create(link) + end + end + end o['app_fifo'].each do |particle| @app_fifo << Edoors::Particle.json_create(particle.merge!('spin'=>self)) end if o['app_fifo'] @@ -58,7 +66,7 @@ module Edoors 'timestamp' => Time.now, 'name' => @name, 'hibernation' => @hibernation, - 'iotas' => @iotas, + 'inner_room' => { :iotas=>@iotas, :links=>@links }, 'sys_fifo' => @sys_fifo, 'app_fifo' => @app_fifo, 'debug_errors' => @debug_errors, |