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: background_migration.rb
    path of file: ./repos/online_migrations/lib/online_migrations
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module OnlineMigrations
  # Base class that is inherited by the host application's background migration classes.
  class BackgroundMigration
    class NotFoundError < NameError; end

    class << self
      # Finds a Background Migration with the given name.
      #
      # @param name [Stri
    
      def named(name)
        namespace = OnlineMigrations.config.background_migrations.migrations_module.constantize
        internal_namespace = ::OnlineMigrations::BackgroundMigrations

        migration = "#{namespace}::#{name}".safe_constantize ||
                    "#{internal_namespace}::#{name}".safe_constantize

        raise NotFoundError.new("Background Migration #{name} not found", name) if migration.nil?
        if !(migration.is_a?(Class) && migration < self)
          raise NotFoundError.new("#{name} is not a Background Migration", name)
        end