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: factories.rb
    path of file: ./repos/activeinteractor/spec/support/helpers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'active_support/core_ext/string/inflections'

module Spec
  module Helpers
    module FactoryCollection
      def self.factories
        @factories ||= []
      end
    
    
      def build_class(class_name, parent_class = nil, &block)
        Object.send(:remove_const, class_name.to_sym) if Object.const_defined?(class_name)
        klass = create_class(class_name, parent_class)
        klass.class_eval(&block) if block
        FactoryCollection.factories << klass.name.to_sym
        klass
      end