Sha256: e192c012b176c8d0b1675fd46e165539709a068813b6bbdd4898b0fc697e956b
Contents?: true
Size: 459 Bytes
Versions: 5
Compression:
Stored size: 459 Bytes
Contents
class Ppl::Format::AddressBook::Nicknames < Ppl::Format::AddressBook attr_writer :table def initialize @table = Ppl::Format::Table.new([:id, :nicknames]) 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
5 entries across 5 versions & 1 rubygems