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
57
58
59
|
# File 'lib/mapi/base.rb', line 57
def email
props.smtp_address || props.org_email_addr || props.email_address
end
|
#inspect ⇒ Object
74
75
76
|
# File 'lib/mapi/base.rb', line 74
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.
51
52
53
54
55
|
# File 'lib/mapi/base.rb', line 51
def name
name = props.transmittable_display_name || props.display_name
name[/^'(.*)'/, 1] or name rescue nil
end
|
#to_s ⇒ Object
66
67
68
69
70
71
72
|
# File 'lib/mapi/base.rb', line 66
def to_s
if name = self.name and !name.empty? and email && name != email
%{"#{name}" <#{email}>}
else
email || name
end
end
|
#type ⇒ Object
62
63
64
|
# File 'lib/mapi/base.rb', line 62
def type
RECIPIENT_TYPES[props.recipient_type]
end
|