Sha256: fffcaf42a5dd7f42b494803a61034ecdeeca22a11f50f317d2bb4968bc5cd11d

Contents?: true

Size: 477 Bytes

Versions: 6

Compression:

Stored size: 477 Bytes

Contents

class Ppl::Format::AddressBook::PhoneNumbers < Ppl::Format::AddressBook

  attr_writer :table

  def initialize
    @table = Ppl::Format::Table.new([:id, :phone_numbers])
  end

  def process(address_book)
    address_book.contacts.each { |contact| add_row(contact) }
    @table.to_s
  end


  private

  def add_row(contact)
    @table.add_row({
      :id            => sprintf("%s:", contact.id),
      :phone_numbers => contact.phone_numbers.join(", "),
    })
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ppl-1.14.1 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.14.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.13.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.12.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.11.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.10.0 lib/ppl/format/address_book/phone_numbers.rb