Sha256: 2e8db74b177d26e73840c2766c70554588c7763653b740a75d8b7d884957923e
Contents?: true
Size: 782 Bytes
Versions: 12
Compression:
Stored size: 782 Bytes
Contents
module SiebelDonations class Contact < Base attr_reader :id, :primary, :first_name, :preferred_name, :middle_name, :last_name, :title, :suffix, :sex, :phone_numbers, :email_addresses, :updated_at 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 def primary_email_address @email_addresses.detect(&:primary) || @email_addresses.first end def primary_phone_number @phone_numbers.detect(&:primary) || @phone_numbers.first end end end
Version data entries
12 entries across 12 versions & 1 rubygems