summaryrefslogtreecommitdiffstats
path: root/lib/edoors
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-06-10 23:27:09 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-06-10 23:27:09 +0200
commit5fbda1780698b2470133672aea247cfd35ba3e85 (patch)
tree18583e4e339038f31a1ae45bf511dbec34b067f3 /lib/edoors
parent71fa3a07057f7ba1d2b27c0b3e98d71354b4a049 (diff)
downloadedoors-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')
-rw-r--r--lib/edoors/spin.rb16
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,