https://github.com/mikel/mail
Ruby
A Really Ruby Mail Library
Mail::Field#initialize
Accepts a string:
Field.new("field-name: field data")
Or name, value pair:
Field.new("field-name", "value")
Or a name by itself:
Field.new("field-name")
Note, does not want a terminating carriage return. Returns
self appropriately parsed. If value is not a string, then
it will be passed through as is, for example, content-type
field can accept an array with the type and a hash of
parameters:
Field.new('content-type', ['text', 'plain', {:charset => 'UTF-8'}])Edit
git clone [email protected]:mikel/mail.git
cd mail
open lib/mail/field.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Mail--Field-initialize-for-pr
# Commit to gitgit add lib/mail/field.rbgit commit -m "better docs for Mail::Field#initialize"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Mail--Field-initialize-for-pr
hub pull-request
# Celebrate!