lib/ezclient/check_options.rb in ezclient-0.10.0 vs lib/ezclient/check_options.rb in ezclient-0.11.0

- old
+ new

@@ -1,10 +1,12 @@ # frozen_string_literal: true module EzClient::CheckOptions def self.call(options, allowed_keys) - if (options.keys - allowed_keys).any? - raise ArgumentError, "Unrecognized options: #{options.keys.map(&:inspect).join(", ")}" + unknown_keys = options.keys - allowed_keys + + if unknown_keys.any? + raise ArgumentError, "Unrecognized options: #{unknown_keys.map(&:inspect).join(", ")}" end options end end