Class: Ppl::Entity::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/ppl/entity/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContact

Returns a new instance of Contact.



12
13
14
# File 'lib/ppl/entity/contact.rb', line 12

def initialize
  @email_addresses = []
end

Instance Attribute Details

#birthdayObject

Returns the value of attribute birthday.



7
8
9
# File 'lib/ppl/entity/contact.rb', line 7

def birthday
  @birthday
end

#email_addressesObject

Returns the value of attribute email_addresses.



6
7
8
# File 'lib/ppl/entity/contact.rb', line 6

def email_addresses
  @email_addresses
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#organizationObject

Returns the value of attribute organization.



9
10
11
# File 'lib/ppl/entity/contact.rb', line 9

def organization
  @organization
end

#phone_numberObject

Returns the value of attribute phone_number.



8
9
10
# File 'lib/ppl/entity/contact.rb', line 8

def phone_number
  @phone_number
end

#postal_addressObject

Returns the value of attribute postal_address.



10
11
12
# File 'lib/ppl/entity/contact.rb', line 10

def postal_address
  @postal_address
end

Instance Method Details

#has_email_address?(email_address) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/ppl/entity/contact.rb', line 23

def has_email_address?(email_address)
  @email_addresses.include? email_address
end

#set_postal_address {|@postal_address| ... } ⇒ Object

Yields:



16
17
18
19
20
21
# File 'lib/ppl/entity/contact.rb', line 16

def set_postal_address
  if @postal_address.nil?
    @postal_address = Ppl::Entity::PostalAddress.new
  end
  yield @postal_address
end