Sha256: 147d501808c8604f611f524057f0c1ac93264b1d08e58157bb07f4a86a4bb752
Contents?: true
Size: 478 Bytes
Versions: 8
Compression:
Stored size: 478 Bytes
Contents
class Ppl::Format::AddressBook::Nicknames < Ppl::Format::AddressBook attr_writer :table def initialize(colors={}) @table = Ppl::Format::Table.new([:id, :nicknames], 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), :nicknames => contact.nicknames.join(", "), }) end end
Version data entries
8 entries across 8 versions & 1 rubygems