Class: Ppl::Format::Contact::Full

Inherits:
Ppl::Format::Contact show all
Defined in:
lib/ppl/format/contact/full.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFull

Returns a new instance of Full.



7
8
9
10
11
# File 'lib/ppl/format/contact/full.rb', line 7

def initialize
  @email_address_format = Ppl::Format::Contact::EmailAddresses.new
  @phone_number_format = Ppl::Format::Contact::PhoneNumber.new
  @postal_address_format = Ppl::Format::Contact::PostalAddresses.new
end

Instance Attribute Details

#email_address_format=(value) ⇒ Object (writeonly)

Sets the attribute email_address_format

Parameters:

  • value

    the value to set the attribute email_address_format to.



3
4
5
# File 'lib/ppl/format/contact/full.rb', line 3

def email_address_format=(value)
  @email_address_format = value
end

#phone_number_format=(value) ⇒ Object (writeonly)

Sets the attribute phone_number_format

Parameters:

  • value

    the value to set the attribute phone_number_format to.



4
5
6
# File 'lib/ppl/format/contact/full.rb', line 4

def phone_number_format=(value)
  @phone_number_format = value
end

#postal_address_format=(value) ⇒ Object (writeonly)

Sets the attribute postal_address_format

Parameters:

  • value

    the value to set the attribute postal_address_format to.



5
6
7
# File 'lib/ppl/format/contact/full.rb', line 5

def postal_address_format=(value)
  @postal_address_format = value
end

Instance Method Details

#process(contact) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ppl/format/contact/full.rb', line 13

def process(contact)
  @lines = []

  first_line = first_line(contact)
  if first_line != ""
    @lines.push(first_line)
  end

  vitals = vitals(contact)
  if vitals != ""
    @lines.push("")
    @lines.push(vitals)
  end

  format_organizations(contact)
  format_email_addresses(contact)
  format_phone_numbers(contact)
  format_postal_addresses(contact)
  format_urls(contact)

  return @lines.join("\n")
end