From 88e38eab7a8c7c0f27a0e4edfdd4c45646a99457 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Wed, 28 Sep 2022 11:04:35 +0200 Subject: [PATCH] Knot::Protocol::Idx fix: if -> unless --- lib/knot/protocol.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/knot/protocol.rb b/lib/knot/protocol.rb index 21c8463..0fda3b3 100644 --- a/lib/knot/protocol.rb +++ b/lib/knot/protocol.rb @@ -78,8 +78,8 @@ module Knot::Protocol::Idx attr_reader :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 Integer for Idx::Id instead of: #{code.inspect}" if Integer === code + raise ArgumentError, "Expecting Symbol for #{self.class.name} instead of: #{name.inspect}" unless Symbol === name + raise ArgumentError, "Expecting Integer for #{self.class.name} instead of: #{code.inspect}" unless Integer === code @name, @code, @cname, @description = name, code, cname, description freeze end