Sha256: ecef12a0b15e0a9695fee83afadcda7b44ce3292301c656d7583ac674ba7b3e7
Contents?: true
Size: 492 Bytes
Versions: 27
Compression:
Stored size: 492 Bytes
Contents
class Ppl::Format::AddressBook::Ages < Ppl::Format::AddressBook attr_writer :table attr_writer :date def initialize(colors={}) @table = Ppl::Format::Table.new([:id, :age], colors) @date = Date.today end def process(address_book) address_book.contacts.each { |contact| add_row(contact) } @table.to_s end private def add_row(contact) @table.add_row({ :id => sprintf("%s:", contact.id), :age => contact.age(@date).to_s, }) end end
Version data entries
27 entries across 27 versions & 1 rubygems