Class: SMail::MIME::Date

Inherits:
DateTime
  • Object
show all
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

Instance Method Details

#to_sObject

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