Class: Ppl::Format::Contact::PostalAddresses

Inherits:
Ppl::Format::Contact show all
Defined in:
lib/ppl/format/contact/postal_addresses.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute postal_address_format to.



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

Parameters:

  • value

    the value to set the attribute table to.



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