diff --git a/lib/ridl/type.rb b/lib/ridl/type.rb index 930a947..143f479 100644 --- a/lib/ridl/type.rb +++ b/lib/ridl/type.rb @@ -263,10 +263,11 @@ class Fixed < Type attr_reader :digits, :scale def initialize(digits = nil, scale = nil) + raise "anonymous fixed definitions are not allowed!" if digits.nil? || scale.nil? raise "significant digits for Fixed should be in the range 0-31" unless digits.nil? || (0..31) === digits.to_i - @digits = digits.nil? ? digits : digits.to_i - @scale = scale.nil? ? scale : scale.to_i + @digits = digits.to_i + @scale = scale.to_i end def narrow(obj)