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: same_window_loader_strategy.rb
    path of file: ./repos/ae_page_objects/lib/ae_page_objects/single_window
    
    the code of the file until where you have to start completion: module AePageObjects
  module SingleWindow
    cla
    
      def load_document_with_condition(condition)
        document = load_document(condition.document_class)

        if document && condition_matches?(document, condition)
          document
        else
          nil
        end
      end