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: validator.rb
    path of file: ./repos/gitlabhq/qa/qa/page
    
    the code of the file until where you have to start completion: # frozen_string_litera
    
      def descendants
        @descendants ||= constants.flat_map do |const|
          case const
          when Class
            const if const < Page::Base
          when Module
            Page::Validator.new(const).descendants
          end
        end.compact
      end