Class: Mail::SenderField
- Inherits:
-
StructuredField
- Object
- StructuredField
- Mail::SenderField
- Includes:
- CommonAddress
- Defined in:
- lib/mail/fields/sender_field.rb
Constant Summary collapse
- FIELD_NAME =
'sender'
- CAPITALIZED_FIELD =
'Sender'
Instance Method Summary collapse
- #address ⇒ Object
- #addresses ⇒ Object
- #decoded ⇒ Object
- #default ⇒ Object
- #encoded ⇒ Object
-
#initialize(*args) ⇒ SenderField
constructor
A new instance of SenderField.
Methods included from CommonAddress
Methods included from Utilities
Methods included from CommonField
Constructor Details
#initialize(*args) ⇒ SenderField
Returns a new instance of SenderField.
37 38 39 40 41 42 |
# File 'lib/mail/fields/sender_field.rb', line 37 def initialize(*args) super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, args.last)) self.parse self end |
Instance Method Details
#address ⇒ Object
48 49 50 |
# File 'lib/mail/fields/sender_field.rb', line 48 def address result = tree.addresses.first end |
#addresses ⇒ Object
44 45 46 |
# File 'lib/mail/fields/sender_field.rb', line 44 def addresses [address.address] end |
#decoded ⇒ Object
56 57 58 |
# File 'lib/mail/fields/sender_field.rb', line 56 def decoded do_decode end |
#default ⇒ Object
60 61 62 |
# File 'lib/mail/fields/sender_field.rb', line 60 def default address.address end |
#encoded ⇒ Object
52 53 54 |
# File 'lib/mail/fields/sender_field.rb', line 52 def encoded do_encode(CAPITALIZED_FIELD) end |