Class: Mail::ReceivedField
- Inherits:
-
NamedStructuredField
- Object
- CommonField
- StructuredField
- NamedStructuredField
- Mail::ReceivedField
- Defined in:
- lib/mail/fields/received_field.rb
Overview
trace = [return]
1*received
return = “Return-Path:” path CRLF
path = ([CFWS] “<” ([CFWS] / addr-spec) “>” [CFWS]) /
obs-path
received = “Received:” name-val-list “;” date-time CRLF
name-val-list = [CFWS] [name-val-pair *(CFWS name-val-pair)]
name-val-pair = item-name CFWS item-value
item-name = ALPHA *([“-”] (ALPHA / DIGIT))
item-value = 1*angle-addr / addr-spec /
atom / domain / msg-id
Constant Summary collapse
- NAME =
:nodoc:
'Received'
Instance Attribute Summary
Attributes inherited from CommonField
#charset, #errors, #name, #value
Instance Method Summary collapse
Methods inherited from NamedStructuredField
Methods inherited from CommonField
#decoded, #default, #encoded, #initialize, parse, #parse, #responsible_for?, #singular?, singular?, #to_s
Constructor Details
This class inherits a constructor from Mail::NamedStructuredField
Instance Method Details
#date_time ⇒ Object
31 32 33 |
# File 'lib/mail/fields/received_field.rb', line 31 def date_time @datetime ||= element.date_time end |
#element ⇒ Object
27 28 29 |
# File 'lib/mail/fields/received_field.rb', line 27 def element @element ||= Mail::ReceivedElement.new(value) end |
#formatted_date ⇒ Object
39 40 41 42 43 |
# File 'lib/mail/fields/received_field.rb', line 39 def formatted_date if date_time.respond_to? :strftime and date_time.respond_to? :zone date_time.strftime("%a, %d %b %Y %H:%M:%S ") + date_time.zone.delete(':') end end |
#info ⇒ Object
35 36 37 |
# File 'lib/mail/fields/received_field.rb', line 35 def info element.info end |