siebel_donations 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,11 +4,19 @@ module SiebelDonations
|
|
4
4
|
attr_reader :id, :primary, :first_name, :preferred_name, :middle_name, :last_name,
|
5
5
|
:title, :sufix, :sex, :phone_numbers, :email_addresses
|
6
6
|
|
7
|
-
def initialize(json)
|
7
|
+
def initialize(json = {})
|
8
8
|
super
|
9
9
|
|
10
|
-
@phone_numbers = json['phoneNumbers'].collect { |phone_json| SiebelDonations::PhoneNumber.new(phone_json) }
|
11
|
-
@email_addresses = json['emailAddresses'].collect { |email_json| SiebelDonations::EmailAddress.new(email_json) }
|
10
|
+
@phone_numbers = json['phoneNumbers'] ? json['phoneNumbers'].collect { |phone_json| SiebelDonations::PhoneNumber.new(phone_json) } : []
|
11
|
+
@email_addresses = json['emailAddresses'] ? json['emailAddresses'].collect { |email_json| SiebelDonations::EmailAddress.new(email_json) } : []
|
12
|
+
end
|
13
|
+
|
14
|
+
def primary_email_address
|
15
|
+
@email_addresses.detect(&:primary) || @email_addresses.first
|
16
|
+
end
|
17
|
+
|
18
|
+
def primary_phone_number
|
19
|
+
@phone_numbers.detect(&:primary) || @phone_numbers.first
|
12
20
|
end
|
13
21
|
|
14
22
|
end
|
@@ -3,7 +3,7 @@ module SiebelDonations
|
|
3
3
|
|
4
4
|
def self.path() '/donations'; end
|
5
5
|
|
6
|
-
attr_reader :id, :amount, :designation, :donor_id, :
|
6
|
+
attr_reader :id, :amount, :designation, :donor_id, :donation_date, :payment_method,
|
7
7
|
:payment_type, :channel, :campaign_code
|
8
8
|
|
9
9
|
end
|
@@ -5,11 +5,19 @@ module SiebelDonations
|
|
5
5
|
|
6
6
|
attr_reader :id, :account_name, :contacts, :addresses, :type
|
7
7
|
|
8
|
-
def initialize(json)
|
8
|
+
def initialize(json = {})
|
9
9
|
super
|
10
10
|
|
11
|
-
@contacts = json['contacts'].collect { |contact_json| SiebelDonations::Contact.new(contact_json) }
|
12
|
-
@addresses = json['addresses'].collect { |address_json| SiebelDonations::Address.new(address_json) }
|
11
|
+
@contacts = json['contacts'] ? json['contacts'].collect { |contact_json| SiebelDonations::Contact.new(contact_json) } : []
|
12
|
+
@addresses = json['addresses'] ? json['addresses'].collect { |address_json| SiebelDonations::Address.new(address_json) } : []
|
13
|
+
end
|
14
|
+
|
15
|
+
def primary_contact
|
16
|
+
@contacts.detect(&:primary) || @contacts.first
|
17
|
+
end
|
18
|
+
|
19
|
+
def primary_address
|
20
|
+
@addresses.detect(&:primary) || @addresses.first
|
13
21
|
end
|
14
22
|
|
15
23
|
end
|
@@ -5,10 +5,10 @@ module SiebelDonations
|
|
5
5
|
|
6
6
|
attr_reader :id, :name, :designations
|
7
7
|
|
8
|
-
def initialize(json)
|
8
|
+
def initialize(json = {})
|
9
9
|
super
|
10
10
|
|
11
|
-
@designations = json['designations'].collect { |designation_json| Designation.new(designation_json) }
|
11
|
+
@designations = json['designations'] ? json['designations'].collect { |designation_json| Designation.new(designation_json) } : []
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siebel_donations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|