Knot::Protocol::Idx fix: if -> unless

This commit is contained in:
Denis Knauf 2022-09-28 11:04:35 +02:00
parent 10645196d1
commit 88e38eab7a

View file

@ -78,8 +78,8 @@ module Knot::Protocol::Idx
attr_reader :name, :code, :cname, :description attr_reader :name, :code, :cname, :description
def initialize name, code, cname, description def initialize name, code, cname, description
raise ArgumentError, "Expecting Symbol for Idx::Id instead of: #{name.inspect}" if Symbol === name raise ArgumentError, "Expecting Symbol for #{self.class.name} instead of: #{name.inspect}" unless Symbol === name
raise ArgumentError, "Expecting Integer for Idx::Id instead of: #{code.inspect}" if Integer === code raise ArgumentError, "Expecting Integer for #{self.class.name} instead of: #{code.inspect}" unless Integer === code
@name, @code, @cname, @description = name, code, cname, description @name, @code, @cname, @description = name, code, cname, description
freeze freeze
end end