diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-24 22:46:15 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-24 22:46:15 +0200 |
commit | 5cbba1e08eed97a5157747e769d80f1fc1b9d675 (patch) | |
tree | 7e36445228d8bca3fb5cca8b82877fa70c39ed9b /lib | |
parent | 9d95dc04c64f7ffff624e21bcf528b5c83e9c209 (diff) | |
download | edoors-ruby-5cbba1e08eed97a5157747e769d80f1fc1b9d675.zip edoors-ruby-5cbba1e08eed97a5157747e769d80f1fc1b9d675.tar.gz |
Iota: raise exception as soon as possible
Diffstat (limited to 'lib')
-rw-r--r-- | lib/iotas/iota.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/iotas/iota.rb b/lib/iotas/iota.rb index e26bf4f..93ea6a1 100644 --- a/lib/iotas/iota.rb +++ b/lib/iotas/iota.rb @@ -24,13 +24,13 @@ module Iotas class Iota # def initialize n, p + raise Iotas::Exception.new "Iota name #{n} is not valid" if n.include? Iotas::PATH_SEP @name = n # unique in it's room @parent = p # single direct parent @viewer = nil # particle going through that position will be sent there readonly @path = ( @parent ? @parent.path+Iotas::PATH_SEP : '') + @name @spin = ( @parent ? @parent.spin : self ) @parent.add_iota self if @parent - raise Iotas::Exception.new "Iota name #{name} is not valid" if @name.include? Iotas::PATH_SEP end # attr_reader :name, :path, :spin |