Class: Ppl::Format::Contact::EmailAddresses
- Inherits:
-
Ppl::Format::Contact
- Object
- Ppl::Format::Contact
- Ppl::Format::Contact::EmailAddresses
- Defined in:
- lib/ppl/format/contact/email_addresses.rb
Instance Attribute Summary collapse
-
#table ⇒ Object
writeonly
Sets the attribute table.
Instance Method Summary collapse
-
#initialize(colors = {}) ⇒ EmailAddresses
constructor
A new instance of EmailAddresses.
- #process(contact) ⇒ Object
Constructor Details
#initialize(colors = {}) ⇒ EmailAddresses
Returns a new instance of EmailAddresses.
5 6 7 |
# File 'lib/ppl/format/contact/email_addresses.rb', line 5 def initialize(colors={}) @table = Ppl::Format::Table.new([:star, :email_addresses], colors) end |
Instance Attribute Details
#table=(value) ⇒ Object (writeonly)
Sets the attribute table
3 4 5 |
# File 'lib/ppl/format/contact/email_addresses.rb', line 3 def table=(value) @table = value end |
Instance Method Details
#process(contact) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ppl/format/contact/email_addresses.rb', line 9 def process(contact) contact.email_addresses.each do |email_address| @table.add_row({ :star => email_address.preferred ? "*" : " ", :email_addresses => email_address.address, }) end @table.to_s end |