church-community-builder 0.1.4 → 0.1.5
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.
- checksums.yaml +8 -8
- data/ccb_api.gemspec +1 -1
- data/examples/api_connect.rb +3 -3
- data/lib/api/batch_list.rb +16 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NjE2MjM3MmViMjU4MzU3MTgxNmQ4OTkwNTQ3OWRkMTNiOTk5YjIwNg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NDRmZTM4OTM2MTc3NjgwMjA0MjEwOTQ0OTFkMGNiNGIzM2RlMTM5Yw==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Y2IwMWIzODQ2NTE3NTcxYzUwODZjZGJkNDc2MzlkYjEyNDdmZjA2NmE3NmMz
|
|
10
|
+
ZGQxY2EyMjU0MDc2NjI3MTJkMWU4MWVhYWQyZDVhZWFjNGRmZjI1MjNkZTY2
|
|
11
|
+
YjBhNGVhMjNhNGI0ZGRkOGI5YTQyNDA2NDRjODYzNTlhNDdmY2E=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
OTUyMWUzN2ViYmYzNTc4ZTJmYzE2NzEyYjJmYWI4NDg0YWE1NDJkOTgwOWM1
|
|
14
|
+
ZmNlY2YwMWY5ZTRkM2U2NGU2ZDZlY2ZmODY4OTFhMzBiMTQyMDU1MmE0Zjk4
|
|
15
|
+
Y2FmYWMzN2EwZWU4MzE3MTFkMjMzNzRmODQ1OGM0MmM2ZWM3NTY=
|
data/ccb_api.gemspec
CHANGED
data/examples/api_connect.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
subdomain = '
|
|
4
|
-
username = '
|
|
5
|
-
password = '
|
|
3
|
+
subdomain = '*** YOUR CHURCH SUBDOMAIN ***'
|
|
4
|
+
username = '*** YOUR CHURCH API USERNAME ***'
|
|
5
|
+
password = '*** YOUR CHURCH API PASSWORD ***'
|
|
6
6
|
|
|
7
7
|
ChurchCommunityBuilder::Api.connect(username, password, subdomain)
|
data/lib/api/batch_list.rb
CHANGED
|
@@ -14,16 +14,22 @@ module ChurchCommunityBuilder
|
|
|
14
14
|
:json_data #for debugging
|
|
15
15
|
|
|
16
16
|
def initialize(json)
|
|
17
|
-
@json_data = json[
|
|
18
|
-
@request_data = @json_data[
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
@json_data = json['ccb_api']
|
|
18
|
+
@request_data = @json_data['request']
|
|
19
|
+
|
|
20
|
+
# This is needed for now to account for the two different formats
|
|
21
|
+
@batches = if @json_data.has_key?('response')
|
|
22
|
+
@response_data = @json_data['response']
|
|
23
|
+
@service = @response_data['service_action'] #CCB service type accessed
|
|
24
|
+
@availability = @response_data['availability']
|
|
25
|
+
# @batches = @response_data['batches']
|
|
26
|
+
@response_data['batches']
|
|
27
|
+
else
|
|
28
|
+
@json_data['batches']
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
@count = @batches['count'].to_i #number of records
|
|
32
|
+
@batch_array = @batches['batch'].class == Array ? @batches['batch'] : [@batches['batch']].compact #array of each batch
|
|
27
33
|
end
|
|
28
34
|
|
|
29
35
|
def all_names
|