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.
6 7 8 9 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 6 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
4 5 6 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 4 def postal_address_format=(value) @postal_address_format = value end |
#table=(value) ⇒ Object (writeonly)
Sets the attribute table
3 4 5 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 3 def table=(value) @table = value end |
Instance Method Details
#process(contact) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/ppl/format/contact/postal_addresses.rb', line 11 def process(contact) contact.postal_addresses.each do |postal_address| format_postal_address(postal_address) end @table.to_s end |