summaryrefslogtreecommitdiffstats
path: root/lib/evendoors/door.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-11 11:36:11 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-12 09:38:01 +0200
commit85eb92f1c6a7309d85a19183e3401d5994483fcd (patch)
tree3ebe3260131c40ff43f95d549de0cd4d8601b49a /lib/evendoors/door.rb
parent0460e82b27c2c84c6873e659107b31d610b7d068 (diff)
downloadedoors-ruby-85eb92f1c6a7309d85a19183e3401d5994483fcd.zip
edoors-ruby-85eb92f1c6a7309d85a19183e3401d5994483fcd.tar.gz
Door: adapt to non static way
Diffstat (limited to 'lib/evendoors/door.rb')
-rw-r--r--lib/evendoors/door.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/evendoors/door.rb b/lib/evendoors/door.rb
index 8a937d5..0729adf 100644
--- a/lib/evendoors/door.rb
+++ b/lib/evendoors/door.rb
@@ -23,10 +23,9 @@ module EvenDoors
#
class Door < Spot
#
- def initialize n, p=nil
+ def initialize n, p
super n, p
@saved = nil
- @parent.add_spot self if @parent
end
#
def to_json *a
@@ -38,22 +37,22 @@ module EvenDoors
#
def self.json_create o
raise EvenDoors::Exception.new "JSON #{o['kls']} != #{self.name}" if o['kls'] != self.name
- self.new o['name']
+ self.new o['name'], o['parent']
end
#
def require_p p_kls
- p = EvenDoors::Spin.require_p p_kls
+ p = spin.require_p p_kls
p.src = self
p
end
#
def release_p p
@saved=nil if @saved==p # particle is released, all is good
- EvenDoors::Spin.release_p p
+ spin.release_p p
end
#
def garbage
- puts " * #{path} didn't give back #{p}" if EvenDoors::Spin.debug_errors
+ puts " * #{path} didn't give back #{p}" if spin.debug_errors
puts "\t#{@saved.data EvenDoors::ERROR_FIELD}" if @saved.action==EvenDoors::ACT_ERROR
release_p @saved
@saved = nil
@@ -68,7 +67,7 @@ module EvenDoors
#
def process_sys_p p
# nothing todo with it now
- EvenDoors::Spin.release_p p
+ spin.release_p p
end
#
def send_p p