Sha256: 1bdcc423e7f9cdd36b6ff12a0f1fc91e28dae9435f867b0eb6fd9936cf17c65f
Contents?: true
Size: 649 Bytes
Versions: 13
Compression:
Stored size: 649 Bytes
Contents
class Ppl::Format::AddressBook::MuttQuery < Ppl::Format::AddressBook attr_writer :table def initialize @table = Ppl::Format::Table.new([:email, :name]) @table.separator = Ppl::Format::Table::SEPARATOR_TABS end def process(address_book) address_book.contacts.each { |contact| add_contact(contact) } @table.to_s end private def add_contact(contact) contact.email_addresses.each do |email_address| add_email_address(email_address, contact.name) end end def add_email_address(email_address, name) @table.add_row({ :email => email_address.address, :name => name, }) end end
Version data entries
13 entries across 13 versions & 1 rubygems