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

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