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

module TurboFlash
  module Renderer
    def render(*args)
      result = super
      if request.format.turbo_stream?
        return result if flash.turbo.cleared?

        flashed = false
        flash_turbo_options = flash.turbo.options
        flash.turbo.flashes.each 
    
    def render(*args)
      result = super
      if request.format.turbo_stream?
        return result if flash.turbo.cleared?

        flashed = false
        flash_turbo_options = flash.turbo.options
        flash.turbo.flashes.each do |key, value|
          flash_options = flash_turbo_options[key]
          if TurboFlash.configuration.inherit_flashes?
            flash.turbo.from_flash(key, value)
            flash_options = flash_turbo_options[key]
          end

          if flash_options.nil?
            flash.discard(key)
            next
          end