Sha256: 4c2b984b22078782cb56f51579c40506404c6764648224d29a8964db70b91e2f

Contents?: true

Size: 588 Bytes

Versions: 10

Compression:

Stored size: 588 Bytes

Contents

class Ppl::Format::AddressBook::EmailAddresses < Ppl::Format::AddressBook

  attr_writer :table

  def initialize
    @table = Ppl::Format::Table.new([:id, :email_address])
  end

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


  private

  def add_row(contact)
    id            = sprintf("%s:", contact.id)
    email_address = nil

    if !contact.email_address.nil?
      email_address = contact.email_address
    end

    @table.add_row({
      :id            => id,
      :email_address => email_address,
    })
  end


end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ppl-1.3.0 lib/ppl/format/address_book/email_addresses.rb
ppl-1.2.0 lib/ppl/format/address_book/email_addresses.rb
ppl-1.1.0 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.6 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.5 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.4 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.3 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.1 lib/ppl/format/address_book/email_addresses.rb
ppl-1.0.0 lib/ppl/format/address_book/email_addresses.rb
ppl-0.9.0 lib/ppl/format/address_book/email_addresses.rb