This class provides the following functionality:
<=> address comments comments= display_name display_name= domain domain= eql? format hash local local= name new parse to_str
Create a new address. If the string argument is not nil, it is parsed for mail addresses and if one is found, it is used to initialize this object.
This is identical to using a RMail::Address::Parser directly like this:
Compare this address with another based on the email address portion only (any display name and comments are ignored). If the other object is not an RMail::Address, it is coerced into a string with its to_str method and then parsed into an RMail::Address object.
Return a hash value for this address. This is based solely on the email address portion (any display name and comments are ignored).
Return true if the two objects are equal. Do this based solely on the email address portion (any display name and comments are ignored). Fails if the other object is not an RMail::Address object.
Retrieve the local portion of the mail address. This is the portion that precedes the @ sign.
Assign the local portion of the mail address. This is the portion that precedes the @ sign.
Returns the display name of this address. The display name is present only for "angle addr" style addresses such as:
John Doe <email@example.com>
In this case, the display name will be "John Doe". In particular this old style address has no display name:
firstname.lastname@example.org (Bob Smith)
Assign a display name to this address. See display_name for a definition of what this is.
See also display_name
Returns a best guess at a display name for this email address. This function first checks if the address has a true display name (see display_name) and returns it if so. Otherwise, if the address has any comments, the last comment will be returned.
In most cases, this will behave reasonably. For example, it will return "Bob Smith" for this address:
email@example.com (Bob Smith)
Returns the comments in this address as an array of strings.
Set the comments for this address. The comments argument can be a string, or an array of strings. In either case, any existing comments are replaced.
Retrieve to the domain portion of the mail address. This is the portion after the @ sign.
Assign a domain name to this address. This is the portion after the @ sign. Any existing domain name will be changed.
Returns the email address portion of the address (i.e. without a display name, angle addresses, or comments).
The string returned is not suitable for insertion into an e-mail. RFC2822 quoting rules are not followed. The raw address is returned instead.
For example, if the local part requires quoting, this function will not perform the quoting (see #format for that). So this function can returns strings such as:
"address with no firstname.lastname@example.org"
See also #format
Return this address as a String formated as appropriate for insertion into a mail message.
This method is also aliased as to_str
Alias for #format