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