Class: Email
- Inherits:
-
MLS::Model
- Object
- ActiveRecord::Base
- MLS::Model
- Defined in:
- lib/mls/models/email.rb
Instance Method Summary collapse
- #bcc ⇒ Object
- #cc ⇒ Object
- #from ⇒ Object
- #multipart? ⇒ Boolean
- #name ⇒ Object
- #parts ⇒ Object
- #reply_to ⇒ Object
- #sender ⇒ Object
- #to ⇒ Object
Instance Method Details
#bcc ⇒ Object
31 32 33 |
# File 'lib/mls/models/email.rb', line 31 def bcc bcc_names.zip(bcc_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ') end |
#cc ⇒ Object
27 28 29 |
# File 'lib/mls/models/email.rb', line 27 def cc cc_names.zip(cc_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ') end |
#from ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/mls/models/email.rb', line 7 def from if from_name "\"#{from_name}\" <#{from_address}>" else from_address end end |
#multipart? ⇒ Boolean
39 40 41 |
# File 'lib/mls/models/email.rb', line 39 def multipart? body.keys.size > 1 end |
#name ⇒ Object
15 16 17 |
# File 'lib/mls/models/email.rb', line 15 def name from_address || from end |
#parts ⇒ Object
43 44 45 |
# File 'lib/mls/models/email.rb', line 43 def parts body.keys end |
#reply_to ⇒ Object
35 36 37 |
# File 'lib/mls/models/email.rb', line 35 def reply_to reply_to_names.zip(reply_to_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ') end |
#sender ⇒ Object
23 24 25 |
# File 'lib/mls/models/email.rb', line 23 def sender headers['Sender'] end |
#to ⇒ Object
19 20 21 |
# File 'lib/mls/models/email.rb', line 19 def to to_names.zip(to_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ') end |