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: header.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/mail-2.6.5/lib/mail
    
    the code of the file until where you have to start completion: # encoding: utf-8
# frozen_string_literal: true
module Mail
  
  # Pr
    
    def fields=(unfolded_fields)
      @fields = Mail::FieldList.new
      warn "Warning: more than #{self.class.maximum_amount} header fields only using the first #{self.class.maximum_amount}" if unfolded_fields.length > self.class.maximum_amount
      unfolded_fields[0..(self.class.maximum_amount-1)].each do |field|

        field = Field.new(field, nil, charset)
        if limited_field?(field.name) && (selected = select_field_for(field.name)) && selected.any? 
          selected.first.update(field.name, field.value)
        else
          @fields << field
        end
      end