summaryrefslogtreecommitdiffstats
path: root/lib/edoors
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-06-18 09:47:20 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-06-18 09:50:55 +0200
commit394ec7f39a83df5edd3eef6667b16698ed689407 (patch)
tree791fef9cee7b3bf13fa6ccfc9d1af1e445e5a37a /lib/edoors
parent81311b79a8efa3705c94b2fa3af0186a1a0776d9 (diff)
downloadedoors-ruby-394ec7f39a83df5edd3eef6667b16698ed689407.zip
edoors-ruby-394ec7f39a83df5edd3eef6667b16698ed689407.tar.gz
implement SYS_ACT_ADD_ROOM
Diffstat (limited to 'lib/edoors')
-rw-r--r--lib/edoors/iota.rb2
-rw-r--r--lib/edoors/room.rb6
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/edoors/iota.rb b/lib/edoors/iota.rb
index 47a2eb6..fcf7573 100644
--- a/lib/edoors/iota.rb
+++ b/lib/edoors/iota.rb
@@ -21,6 +21,8 @@
#
module Edoors
#
+ IOTA_NAME = 'edoors_iota_name'.freeze
+ #
class Iota
#
def initialize n, p
diff --git a/lib/edoors/room.rb b/lib/edoors/room.rb
index 1c855c1..5936e27 100644
--- a/lib/edoors/room.rb
+++ b/lib/edoors/room.rb
@@ -58,6 +58,10 @@ module Edoors
room
end
#
+ def self.from_particle_data p, s
+ Edoors::Room.new(p.get_data(Edoors::IOTA_NAME), s)
+ end
+ #
def add_iota s
raise Edoors::Exception.new "Iota #{s.name} already has #{s.parent.name} as parent" if not s.parent.nil? and s.parent!=self
raise Edoors::Exception.new "Iota #{s.name} already exists in #{path}" if @iotas.has_key? s.name
@@ -179,6 +183,8 @@ module Edoors
def process_sys_p p
if p.action==Edoors::SYS_ACT_ADD_LINK
add_link Edoors::Link.from_particle_data p
+ elsif p.action==Edoors::SYS_ACT_ADD_ROOM
+ Edoors::Room.from_particle_data p, self
end
@spin.release_p p
end