# File lib/rmail/header.rb, line 331 def add(name, value, index = nil, params = nil) value = value.to_str if params value = value.dup sep = "; " params.each do |n, v| value << sep value << n.to_s value << '=' v = v.to_s if v =~ /^\w+$/ value << v else value << '"' value << v value << '"' end end end field = Field.new(name, value) index ||= @fields.length @fields[index, 0] = field self end