Class: Ppl::Format::Contact::PhoneNumber

Inherits:
Ppl::Format::Contact show all
Defined in:
lib/ppl/format/contact/phone_number.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(colors = {}) ⇒ PhoneNumber

Returns a new instance of PhoneNumber.



6
7
8
# File 'lib/ppl/format/contact/phone_number.rb', line 6

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

Instance Attribute Details

#table=(value) ⇒ Object (writeonly)

Sets the attribute table

Parameters:

  • value

    the value to set the attribute table to.



4
5
6
# File 'lib/ppl/format/contact/phone_number.rb', line 4

def table=(value)
  @table = value
end

Instance Method Details

#process(contact) ⇒ Object



10
11
12
13
# File 'lib/ppl/format/contact/phone_number.rb', line 10

def process(contact)
  contact.phone_numbers.each { |pn| add_row(pn) }
  @table.to_s
end