Class: Email

Inherits:
MLS::Model show all
Defined in:
lib/mls/email.rb

Instance Method Summary collapse

Instance Method Details

#bccObject



30
31
32
# File 'lib/mls/email.rb', line 30

def bcc
  bcc_names.zip(bcc_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ')
end

#ccObject



26
27
28
# File 'lib/mls/email.rb', line 26

def cc
  cc_names.zip(cc_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ')
end

#fromObject



6
7
8
9
10
11
12
# File 'lib/mls/email.rb', line 6

def from
  if from_name
    "\"#{from_name}\" <#{from_address}>"
  else
    from_address
  end
end

#multipart?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/mls/email.rb', line 38

def multipart?
  body.keys.size > 1
end

#nameObject



14
15
16
# File 'lib/mls/email.rb', line 14

def name
  from
end

#partsObject



42
43
44
# File 'lib/mls/email.rb', line 42

def parts
  body.keys
end

#reply_toObject



34
35
36
# File 'lib/mls/email.rb', line 34

def reply_to
  reply_to_names.zip(reply_to_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ')
end

#senderObject



22
23
24
# File 'lib/mls/email.rb', line 22

def sender
  headers['Sender']
end

#toObject



18
19
20
# File 'lib/mls/email.rb', line 18

def to
  to_names.zip(to_addresses).map{|t| t[0] ? "\"#{t[0]}\" <#{t[1]}>" : t[1] }.join(', ')
end