def can_be_enqueued?(document)
      archivable?(document) &&
      # ensure the next document is on an allowable domain
      valid_domains.include?(document.url.host) &&
      # ensure the next document hasn't been processed yet
      !processed_urls.include?(document.url.canonical_url) &&
      # ensure the next document hasn't been enqueued yet
      !unprocessed_urls.include?(document.url.canonical_url)
    end
def can_be_enqueued?(document)
      archivable?(document) &&
      # ensure the next document is on an allowable domain
      valid_domains.include?(document.url.host) &&
      # ensure the next document hasn't been processed yet
      !processed_urls.include?(document.url.canonical_url) &&
      # ensure the next document hasn't been enqueued yet
      !unprocessed_urls.include?(document.url.canonical_url)
    end
Determine if a document can be enqueued