From 5cbba1e08eed97a5157747e769d80f1fc1b9d675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 24 May 2012 22:46:15 +0200 Subject: Iota: raise exception as soon as possible --- lib/iotas/iota.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.1-2-g2b99