Class: Mail::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/mails_viewer/mail.rb

Instance Method Summary collapse

Instance Method Details

#filename_for(to) ⇒ Object

Save the mail to separate files when have several destination addresses This function used to return a filename by mail’s date and destination address



5
6
7
8
# File 'lib/mails_viewer/mail.rb', line 5

def filename_for(to)
  timestamp = (date && date.to_time) || Time.now
  "#{timestamp.to_i}.#{to}.txt"
end