Sha256: 0988062b7ee84bfd7b249d8c09ebdd057709d599783d646f9a127cd6a3e89b01

Contents?: true

Size: 533 Bytes

Versions: 19

Compression:

Stored size: 533 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

  def disable_colors!
    @table.disable_colors!
  end

  private

  def add_row(contact)
    @table.add_row({
      :id        => sprintf("%s:", contact.id),
      :nicknames => contact.nicknames.join(", "),
    })
  end


end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ppl-3.0.1 lib/ppl/format/address_book/nicknames.rb
ppl-3.0.0 lib/ppl/format/address_book/nicknames.rb
ppl-2.4.1 lib/ppl/format/address_book/nicknames.rb
ppl-2.4.0 lib/ppl/format/address_book/nicknames.rb
ppl-2.3.3 lib/ppl/format/address_book/nicknames.rb
ppl-2.3.2 lib/ppl/format/address_book/nicknames.rb
ppl-2.3.1 lib/ppl/format/address_book/nicknames.rb
ppl-2.3.0 lib/ppl/format/address_book/nicknames.rb
ppl-2.2.0 lib/ppl/format/address_book/nicknames.rb
ppl-2.1.0 lib/ppl/format/address_book/nicknames.rb
ppl-2.0.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.25.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.24.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.23.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.22.2 lib/ppl/format/address_book/nicknames.rb
ppl-1.22.1 lib/ppl/format/address_book/nicknames.rb
ppl-1.22.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.21.0 lib/ppl/format/address_book/nicknames.rb
ppl-1.20.0 lib/ppl/format/address_book/nicknames.rb