summaryrefslogtreecommitdiffstats
path: root/lib/evendoors/room.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-10 17:47:55 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-10 17:47:55 +0200
commit8e2408c735e659741542d66cd032d4c3405cd5e0 (patch)
treec40e4dad0cf8d221c890b315e2c25c595c7be3b3 /lib/evendoors/room.rb
parentc596b64931fec2db2c1a198b7124431b04fc673d (diff)
downloadedoors-ruby-8e2408c735e659741542d66cd032d4c3405cd5e0.zip
edoors-ruby-8e2408c735e659741542d66cd032d4c3405cd5e0.tar.gz
Room#resolve -> Room#search_down
Diffstat (limited to 'lib/evendoors/room.rb')
-rw-r--r--lib/evendoors/room.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index eaa8ace..90b824c 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -42,17 +42,14 @@ module EvenDoors
@spin = ( @parent.nil? ? self : @parent.spin )
end
#
- def resolve search
- return self if search==path
- if (search=~/^#{path}\/(\w+)\/?/)==0
- if spot = @spots[$1]
- return spot if spot.path==search # needed as Door doesn't implement #resolve
- return spot.resolve search
- else
- nil
- end
+ def search_down spath
+ return self if spath==path
+ return nil if (spath=~/^#{path}\/(\w+)\/?/)!=0
+ if spot = @spots[$1]
+ return spot if spot.path==spath # needed as Door doesn't implement #search_down
+ return spot.search_down spath
end
- (@parent ? @parent.resolve(search) : nil )
+ nil
end
#
def try_links p