Class: SMail::MIME::Date
- Inherits:
-
DateTime
- Object
- DateTime
- SMail::MIME::Date
- Defined in:
- lib/smail/mime/date.rb
Overview
We inherit from DateTime in order to make its to_s method return an RFC2822 compliant date string.
Instance Method Summary collapse
-
#to_s ⇒ Object
Return an RFC2822 compliant date string suitable for use in the Date header.
Instance Method Details
#to_s ⇒ Object
Return an RFC2822 compliant date string suitable for use in the Date header.
7 8 9 10 |
# File 'lib/smail/mime/date.rb', line 7 def to_s # This should meet RFC2822 requirements self.strftime('%a, %e %b %Y %H:%M:%S %z').gsub(/\s+/, ' ') end |