summaryrefslogtreecommitdiffstats
path: root/lib/edoors
diff options
context:
space:
mode:
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