Class: Ppl::Format::AddressBook::Nicknames

Inherits:
Ppl::Format::AddressBook show all
Defined in:
lib/ppl/format/address_book/nicknames.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(colors = {}) ⇒ Nicknames

Returns a new instance of Nicknames.



5
6
7
# File 'lib/ppl/format/address_book/nicknames.rb', line 5

def initialize(colors={})
  @table = Ppl::Format::Table.new([:id, :nicknames], colors)
end

Instance Attribute Details

#table=(value) ⇒ Object (writeonly)

Sets the attribute table

Parameters:

  • value

    the value to set the attribute table to.



3
4
5
# File 'lib/ppl/format/address_book/nicknames.rb', line 3

def table=(value)
  @table = value
end

Instance Method Details

#disable_colors!Object



14
15
16
# File 'lib/ppl/format/address_book/nicknames.rb', line 14

def disable_colors!
  @table.disable_colors!
end

#process(address_book) ⇒ Object



9
10
11
12
# File 'lib/ppl/format/address_book/nicknames.rb', line 9

def process(address_book)
  address_book.contacts.each { |contact| add_row(contact) }
  @table.to_s
end