Sha256: 33c85a889a57bea0cddbb9ecfb035f7d980200f4e5aad8eb1eced452208b5b17
Contents?: true
Size: 586 Bytes
Versions: 18
Compression:
Stored size: 586 Bytes
Contents
class Ppl::Format::AddressBook::Organizations < Ppl::Format::AddressBook attr_writer :table def initialize @table = Ppl::Format::Table.new([:id, :organization]) end def process(address_book) address_book.each { |contact| add_row(contact) } @table.to_s end private def add_row(contact) contact_id = sprintf("%s:", contact.id) organization = nil if !contact.organization.nil? organization = contact.organization end @table.add_row({ :id => contact_id, :organization => organization, }) end end
Version data entries
18 entries across 18 versions & 1 rubygems