Class: Maildis::Recipient
- Inherits:
-
Object
- Object
- Maildis::Recipient
- Defined in:
- lib/maildis/recipient.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#merge_fields ⇒ Object
Returns the value of attribute merge_fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, email, merge_fields = []) ⇒ Recipient
constructor
A new instance of Recipient.
- #to_email ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, email, merge_fields = []) ⇒ Recipient
Returns a new instance of Recipient.
6 7 8 9 10 |
# File 'lib/maildis/recipient.rb', line 6 def initialize(name, email, merge_fields=[]) @name = name @email = email @merge_fields = merge_fields end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/maildis/recipient.rb', line 3 def email @email end |
#merge_fields ⇒ Object
Returns the value of attribute merge_fields.
4 5 6 |
# File 'lib/maildis/recipient.rb', line 4 def merge_fields @merge_fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/maildis/recipient.rb', line 3 def name @name end |
Instance Method Details
#to_email ⇒ Object
12 13 14 15 |
# File 'lib/maildis/recipient.rb', line 12 def to_email return "#{@name} <#{@email}>" if @name @email end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/maildis/recipient.rb', line 17 def to_s "<Recipient #{name} | #{email}>" end |