Class: Mapi::Recipient
- Inherits:
-
Item
- Object
- Item
- Mapi::Recipient
show all
- Defined in:
- lib/mapi/base.rb
Constant Summary
collapse
- RECIPIENT_TYPES =
{ 0 => :orig, 1 => :to, 2 => :cc, 3 => :bcc }
Instance Attribute Summary
Attributes inherited from Item
#properties
Instance Method Summary
collapse
Methods inherited from Item
#initialize
Constructor Details
This class inherits a constructor from Mapi::Item
Instance Method Details
#email ⇒ Object
56
57
58
|
# File 'lib/mapi/base.rb', line 56
def email
props.smtp_address || props.org_email_addr || props.email_address
end
|
#inspect ⇒ Object
73
74
75
|
# File 'lib/mapi/base.rb', line 73
def inspect
"#<#{self.class.to_s[/\w+$/]}:#{self.to_s.inspect}>"
end
|
#name ⇒ Object
some kind of best effort guess for converting to standard mime style format. there are some rules for encoding non 7bit stuff in mail headers. should obey that here, as these strings could be unicode email_address will be an EX:/ address (X.400?), unless external recipient. the other two we try first. consider using entry id for this too.
50
51
52
53
54
|
# File 'lib/mapi/base.rb', line 50
def name
name = props.transmittable_display_name || props.display_name
name[/^'(.*)'/, 1] or name rescue nil
end
|
#to_s ⇒ Object
65
66
67
68
69
70
71
|
# File 'lib/mapi/base.rb', line 65
def to_s
if name = self.name and !name.empty? and email && name != email
%{"#{name}" <#{email}>}
else
email || name
end
end
|
#type ⇒ Object
61
62
63
|
# File 'lib/mapi/base.rb', line 61
def type
RECIPIENT_TYPES[props.recipient_type]
end
|