Class: Mail::Envelope

Inherits:
StructuredField show all
Defined in:
lib/mail/envelope.rb

Constant Summary

Constant Summary

Constants included from Patterns

Patterns::ATOM_UNSAFE, Patterns::CONTROL_CHAR, Patterns::CRLF, Patterns::FIELD_BODY, Patterns::FIELD_LINE, Patterns::FIELD_NAME, Patterns::FIELD_PREFIX, Patterns::FIELD_SPLIT, Patterns::FWS, Patterns::HEADER_LINE, Patterns::HEADER_SPLIT, Patterns::PHRASE_UNSAFE, Patterns::QP_SAFE, Patterns::QP_UNSAFE, Patterns::TEXT, Patterns::TOKEN_UNSAFE, Patterns::WSP

Instance Method Summary (collapse)

Methods inherited from StructuredField

#charset, #charset=, #default, #errors

Methods included from Utilities

#atom_safe?, #bracket, #capitalize_field, #constantize, #dasherize, #dquote, #escape_paren, #map_lines, #map_with_index, #match_to_s, #paren, #quote_atom, #quote_phrase, #quote_token, #token_safe?, #unbracket, #underscoreize, #unparen, #unquote, #uri_escape, #uri_parser, #uri_unescape

Methods included from CommonField

#default, #field_length, #name, #name=, #responsible_for?, #to_s, #value, #value=

Constructor Details

- (Envelope) initialize(*args)



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

- (Object) date



21
22
23
# File 'lib/mail/envelope.rb', line 21

def date
  ::DateTime.parse("#{element.date_time}")
end

- (Object) element



17
18
19
# File 'lib/mail/envelope.rb', line 17

def element
  @element ||= Mail::EnvelopeFromElement.new(value)
end

- (Object) from



25
26
27
# File 'lib/mail/envelope.rb', line 25

def from
  element.address
end