summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/edoors.rb1
-rw-r--r--lib/edoors/iota.rb2
-rw-r--r--lib/edoors/room.rb6
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/edoors.rb b/lib/edoors.rb
index 76b47bd..d70d5bf 100644
--- a/lib/edoors.rb
+++ b/lib/edoors.rb
@@ -31,6 +31,7 @@ module Edoors
#
SYS_ACT_HIBERNATE = 'hibernate'.freeze
SYS_ACT_ADD_LINK = 'sys_add_link'.freeze
+ SYS_ACT_ADD_ROOM = 'sys_add_room'.freeze
#
FIELD_ERROR_MSG = 'edoors_error'.freeze
FIELD_HIBERNATE_PATH = 'hibernate_path'.freeze
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