Class: Mail::Envelope
- Inherits:
-
StructuredField
- Object
- StructuredField
- Mail::Envelope
- Defined in:
- lib/mail/envelope.rb
Instance Method Summary collapse
- #date ⇒ Object
- #element ⇒ Object
- #from ⇒ Object
-
#initialize(*args) ⇒ Envelope
constructor
A new instance of Envelope.
- #tree ⇒ Object
Methods inherited from StructuredField
Methods included from Utilities
Methods included from CommonField
Constructor Details
#initialize(*args) ⇒ Envelope
Returns a new instance of Envelope.
13 14 15 |
# File 'lib/mail/envelope.rb', line 13 def initialize(*args) super(FIELD_NAME, strip_field(FIELD_NAME, args.last)) end |
Instance Method Details
#date ⇒ Object
26 27 28 |
# File 'lib/mail/envelope.rb', line 26 def date ::DateTime.parse("#{element.date_time}") end |
#element ⇒ Object
22 23 24 |
# File 'lib/mail/envelope.rb', line 22 def element @element ||= Mail::EnvelopeFromElement.new(value) end |
#from ⇒ Object
30 31 32 |
# File 'lib/mail/envelope.rb', line 30 def from element.address end |
#tree ⇒ Object
17 18 19 20 |
# File 'lib/mail/envelope.rb', line 17 def tree @element ||= Mail::EnvelopeFromElement.new(value) @tree ||= @element.tree end |