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: builder.rb
    path of file: ./repos/spyke/lib/spyke/associations
    
    the code of the file until where you have to start completion: module Spyke
  module Associations
    class Builder
      def initialize(parent_class, name, type, options = {})
        @parent_class, @name, @type, @options = parent_class, name, type, options
      end

      def build(parent)
        @type.new(klass, parent, @name, @options)
      end

      def klass
        @klass ||= custom_class || compute_class(@n
    
        def compute_class(type_name)
          parent_name = @parent_class.to_s
          type_name = type_name.to_s.classify

          candidates = []
          parent_name.scan(/::|$/) { candidates.unshift "#{$`}::#{type_name}" }
          candidates << type_name

          candidates.each do |candidate|
            constant = candidate.safe_constantize
            return constant if candidate == constant.to_s
          end
          raise NameError.new("uninitialized constant #{candidates.first}", candidates.first)
        end