You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: struct_builder.rb
    path of file: ./repos/dry-struct/lib/dry/struct
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Dry
  class Struct
    # @private
    class StructBuilder < Compiler
      attr_reader :struct

      def initialize(struct)
        super(Types)
        @struct = struct
      end

      # @param [Symbol|String] attr_nam
    
      def call(attr_name, type, &block)
        const_name = const_name(type, attr_name)
        check_name(const_name)

        builder = self
        parent = parent(type)

        new_type = ::Class.new(Undefined.default(parent, struct.abstract_class)) do
          if Undefined.equal?(parent)
            schema builder.struct.schema.clear
          end

          class_exec(&block)
        end