Class: Ppl::Format::Contact::Full
- Inherits:
-
Ppl::Format::Contact
- Object
- Ppl::Format::Contact
- Ppl::Format::Contact::Full
- Defined in:
- lib/ppl/format/contact/full.rb
Instance Attribute Summary collapse
-
#email_address_format ⇒ Object
writeonly
Sets the attribute email_address_format.
-
#phone_number_format ⇒ Object
writeonly
Sets the attribute phone_number_format.
-
#postal_address_format ⇒ Object
writeonly
Sets the attribute postal_address_format.
Instance Method Summary collapse
-
#initialize ⇒ Full
constructor
A new instance of Full.
- #process(contact) ⇒ Object
Constructor Details
#initialize ⇒ Full
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
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
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
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 |