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: document_fragment.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/loofah-2.0.3/lib/loofah/html
    
    the code of the file until where you have to start completion: module Loofah
  module HTML # :nodoc:
    #
    #  Subclass of Nokogiri::HTML::DocumentFragment.
    #
    #  See Loofah::ScrubBehavior and Loofah::TextBehavior for 
    
        def parse tags, encoding = nil
          doc = Loofah::HTML::Document.new

          encoding ||= tags.respond_to?(:encoding) ? tags.encoding.name : 'UTF-8'
          doc.encoding = encoding

          new(doc, tags)
        end