Sha256: 44a96ea453d80adfed7ca3bffa7c246673adef5c9fee0febd4267066544b2f16

Contents?: true

Size: 496 Bytes

Versions: 9

Compression:

Stored size: 496 Bytes

Contents

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

  attr_writer :table

  def initialize(colors={})
    @table = Ppl::Format::Table.new([:id, :phone_numbers], colors)
  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

9 entries across 9 versions & 1 rubygems

Version Path
ppl-1.20.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.19.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.18.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.17.2 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.17.1 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.17.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.16.0 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.15.1 lib/ppl/format/address_book/phone_numbers.rb
ppl-1.15.0 lib/ppl/format/address_book/phone_numbers.rb