Class: Ppl::Format::Contact::PostalAddresses
- Inherits:
-
Ppl::Format::Contact
- Object
- Ppl::Format::Contact
- Ppl::Format::Contact::PostalAddresses
- Defined in:
- lib/ppl/format/contact/postal_addresses.rb
Instance Attribute Summary collapse
-
#postal_address_format ⇒ Object
writeonly
Sets the attribute postal_address_format.
-
#table ⇒ Object
writeonly
Sets the attribute table.
Instance Method Summary collapse
-
#initialize(colors = {}) ⇒ PostalAddresses
constructor
A new instance of PostalAddresses.
- #process(contact) ⇒ Object
Constructor Details
#initialize(colors = {}) ⇒ PostalAddresses
Returns a new instance of PostalAddresses.
7 8 9 10 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 7 def initialize(colors={}) @table = Ppl::Format::Table.new([:star, :address_id, :address_text], colors) @postal_address_format = Ppl::Format::PostalAddress::OneLine.new end |
Instance Attribute Details
#postal_address_format=(value) ⇒ Object (writeonly)
Sets the attribute postal_address_format
5 6 7 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 5 def postal_address_format=(value) @postal_address_format = value end |
#table=(value) ⇒ Object (writeonly)
Sets the attribute table
4 5 6 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 4 def table=(value) @table = value end |
Instance Method Details
#process(contact) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 12 def process(contact) contact.postal_addresses.each do |postal_address| format_postal_address(postal_address) end @table.to_s end |