public Method

Mail.date( default = nil )

Returns the date of the email message as per the "date" header value or returns nil by default (if no date field exists).

You can also pass whatever default you want into this method and it will return that instead of nil if there is no date already set.

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 115
def date( default = nil )
  if h = @header['date']
    h.date
  else
    default
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.