diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:47:38 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:47:38 +0200 |
commit | 3da69540ac0dae8caeb4b6e8c48c96f2e8b56856 (patch) | |
tree | e377b5544c81537b0e28827975af751e2bbc6065 | |
parent | ae1c6bd6b6b3f58576006602090acf2c1f37843e (diff) | |
download | edoors-ruby-3da69540ac0dae8caeb4b6e8c48c96f2e8b56856.zip edoors-ruby-3da69540ac0dae8caeb4b6e8c48c96f2e8b56856.tar.gz |
Particle: #split_dst! clear all if next_dst empty or nil
-rw-r--r-- | lib/evendoors/particle.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/evendoors/particle.rb b/lib/evendoors/particle.rb index c81b16a..ee4a8a8 100644 --- a/lib/evendoors/particle.rb +++ b/lib/evendoors/particle.rb @@ -57,8 +57,10 @@ module EvenDoors end # def split_dst! - @dst = nil - p, @action = next_dst.split EvenDoors::ACT_SEP + @dst = @room = @door = @action = nil + n = next_dst + return if n.nil? or n.empty? + p, @action = n.split EvenDoors::ACT_SEP i = p.rindex EvenDoors::PATH_SEP if i.nil? @room = nil |