class Google::Cloud::Config

def build_match_validator! matches, allow_nil

def build_match_validator! matches, allow_nil
  matches = ::Kernel.Array(matches)
  matches += [nil] if allow_nil && !matches.include?(nil)
  ->(val) { matches.any? { |m| m.send :===, val } }
end