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: namespaced_class.rb
    path of file: ./repos/gitlabhq/rubocop/cop/gitlab
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RuboCop
  module Cop
    module Gitlab
      # Cop that enforces use of namespaced classes in order to better identify
      # high level domains within the codebase.
      #
      # @example
      #   # bad
      #   class MyClass
      #   end
      #
      #   module Gitlab
      #     cla
    
        def on_class(node)
          # Add potential namespaces from compact definitions like `class Foo::Bar`.
          # Remove class name because it's not a domain namespace.
          add_potential_domain_namespace(node) { _1.pop }

          add_offense(node.loc.name) if domain_namespaces.none?
        end

        private

        def domain_namespaces
          @domain_namespaces ||= []
        end

        def add_potential_domain_namespace(node)
          return if domain_namespaces.any?

          identifiers = identifiers_for(node)
          yield(identifiers) if block_given?

          PSEUDO_TOPLEVEL.each do |namespaces|
            identifiers.shift(namespaces.size) if namespaces == identifiers.first(namespaces.size)
          end

          domain_namespaces.concat(identifiers)
        end

        def identifiers_for(node)
          node.identifier.source.sub(/^::/, '').split('::')
        end
      end
    end
  end