Class: Mail::ResentDateField
- Inherits:
-
StructuredField
- Object
- StructuredField
- Mail::ResentDateField
- Includes:
- CommonDate
- Defined in:
- lib/mail/fields/resent_date_field.rb
Constant Summary collapse
- FIELD_NAME =
'resent-date'
- CAPITALIZED_FIELD =
'Resent-Date'
Instance Method Summary collapse
- #decoded ⇒ Object
- #encoded ⇒ Object
-
#initialize(*args) ⇒ ResentDateField
constructor
A new instance of ResentDateField.
Methods included from CommonDate
Methods inherited from StructuredField
Methods included from Utilities
Methods included from CommonField
Constructor Details
#initialize(*args) ⇒ ResentDateField
Returns a new instance of ResentDateField.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mail/fields/resent_date_field.rb', line 12 def initialize(*args) if args.last.blank? self.name = CAPITALIZED_FIELD self.value = Time.now.strftime('%a, %d %b %Y %H:%M:%S %z') self else value = strip_field(FIELD_NAME, args.last) value = ::DateTime.parse(value.to_s).strftime('%a, %d %b %Y %H:%M:%S %z') super(CAPITALIZED_FIELD, value) end end |
Instance Method Details
#decoded ⇒ Object
28 29 30 |
# File 'lib/mail/fields/resent_date_field.rb', line 28 def decoded do_decode end |
#encoded ⇒ Object
24 25 26 |
# File 'lib/mail/fields/resent_date_field.rb', line 24 def encoded do_encode(CAPITALIZED_FIELD) end |