Class: SiebelDonations::Contact
- Defined in:
- lib/siebel_donations/contact.rb
Instance Attribute Summary collapse
-
#email_addresses ⇒ Object
readonly
Returns the value of attribute email_addresses.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
readonly
Returns the value of attribute middle_name.
-
#phone_numbers ⇒ Object
readonly
Returns the value of attribute phone_numbers.
-
#preferred_name ⇒ Object
readonly
Returns the value of attribute preferred_name.
-
#primary ⇒ Object
readonly
Returns the value of attribute primary.
-
#sex ⇒ Object
readonly
Returns the value of attribute sex.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json = {}) ⇒ Contact
constructor
A new instance of Contact.
- #primary_email_address ⇒ Object
- #primary_phone_number ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(json = {}) ⇒ Contact
Returns a new instance of Contact.
7 8 9 10 11 12 |
# File 'lib/siebel_donations/contact.rb', line 7 def initialize(json = {}) super @phone_numbers = json['phoneNumbers'] ? json['phoneNumbers'].collect { |phone_json| SiebelDonations::PhoneNumber.new(phone_json) } : [] @email_addresses = json['emailAddresses'] ? json['emailAddresses'].collect { |email_json| SiebelDonations::EmailAddress.new(email_json) } : [] end |
Instance Attribute Details
#email_addresses ⇒ Object (readonly)
Returns the value of attribute email_addresses.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def email_addresses @email_addresses end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def first_name @first_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def id @id end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def last_name @last_name end |
#middle_name ⇒ Object (readonly)
Returns the value of attribute middle_name.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def middle_name @middle_name end |
#phone_numbers ⇒ Object (readonly)
Returns the value of attribute phone_numbers.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def phone_numbers @phone_numbers end |
#preferred_name ⇒ Object (readonly)
Returns the value of attribute preferred_name.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def preferred_name @preferred_name end |
#primary ⇒ Object (readonly)
Returns the value of attribute primary.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def primary @primary end |
#sex ⇒ Object (readonly)
Returns the value of attribute sex.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def sex @sex end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def suffix @suffix end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def title @title end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/siebel_donations/contact.rb', line 4 def updated_at @updated_at end |
Instance Method Details
#primary_email_address ⇒ Object
14 15 16 |
# File 'lib/siebel_donations/contact.rb', line 14 def primary_email_address @email_addresses.detect(&:primary) || @email_addresses.first end |
#primary_phone_number ⇒ Object
18 19 20 |
# File 'lib/siebel_donations/contact.rb', line 18 def primary_phone_number @phone_numbers.detect(&:primary) || @phone_numbers.first end |