<commit_before>module RubyEmail
  class HeaderField < Base
    attr_accessor :name, :body
  end
end<commit_msg>Modified the HeaderField object to validate the name(key) and added a constructor<commit_after>module RubyEmail
  
  # This object is used by the Message and BodyPart objects
  class HeaderField < Base
    
    attr_reader :name, :body
        
    def initialize(name, body)
      super()           
      @name, @body = name, body
      valid_header_field_name?
    end
    
    # Validate the name. Should not be empty or nil
    def valid_header_field_name?
      unless (@name and @name.length > 0) and @name
        raise("Name should not be empty!")
      end      
      return true
    end
  end
end
{'fraction_non_alphanumeric': 0.059805285118219746, 'fraction_numerical': 0.0013908205841446453, 'mean_word_length': 2.495145631067961, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3055869', 'n_tokens_mistral': 206, 'n_tokens_neox': 205, 'n_words': 77}