Sha256: dddbe53f7cbb114a3c9980fa7daba10fc6ff6faabc8769463982238eea12a275
Contents?: true
Size: 502 Bytes
Versions: 18
Compression:
Stored size: 502 Bytes
Contents
class Ppl::Format::AddressBook::Names < Ppl::Format::AddressBook attr_writer :table def initialize @table = Ppl::Format::Table.new([:id, :name]) 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) name = nil if !contact.name.nil? name = contact.name end @table.add_row({ :id => id, :name => name, }) end end
Version data entries
18 entries across 18 versions & 1 rubygems