Class: Ppl::Format::AddressBook::MuttQuery

Inherits:
Ppl::Format::AddressBook show all
Defined in:
lib/ppl/format/address_book/mutt_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMuttQuery

Returns a new instance of MuttQuery.



6
7
8
9
# File 'lib/ppl/format/address_book/mutt_query.rb', line 6

def initialize
  @table = Ppl::Format::Table.new([:email, :name])
  @table.separator = Ppl::Format::Table::SEPARATOR_TABS
end

Instance Attribute Details

#table=(value) ⇒ Object (writeonly)

Sets the attribute table

Parameters:

  • value

    the value to set the attribute table to.



4
5
6
# File 'lib/ppl/format/address_book/mutt_query.rb', line 4

def table=(value)
  @table = value
end

Instance Method Details

#process(address_book) ⇒ Object



11
12
13
14
# File 'lib/ppl/format/address_book/mutt_query.rb', line 11

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