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

require 'thredded/email_transformer/base'
module Thredded
  module EmailTransformer
    # Changes the spoiler tags to work in emails.
   
    
      def call
        doc.css('.thredded--post--content--spoiler--summary').each do |node|
          node.content = I18n.t('thredded.posts.spoiler_summary_for_email')
        end
        doc.css('.thredded--post--content--spoiler--contents img').each do |img|
          text = "#{img['src']} #{" (#{img['alt']})" if img['alt'].present?}"
          img.swap(
            if img.parent.name == 'a' && img.parent.children.size == 1
              doc.document.create_text_node(text)
            else
              doc.document.create_element('a', text, href: img['src'], target: '_blank')
            end
          )
        end