church_community_builder 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c49607b4bba46ccf9d09040ee949aae5d2c5deb
4
- data.tar.gz: ff411c4b73dc6e811af8f26d40ebbbee4d36abe7
3
+ metadata.gz: 00758bc1f576757f0ef02435f2218fe82c6960cd
4
+ data.tar.gz: 29c6aad97d3edb45751394f9369c2428e3d07529
5
5
  SHA512:
6
- metadata.gz: b4c403520c66d69383cf2f341878c1c444097f76a048f0c968f56ec1879074daca3f90ad982592e011792f9a2e02b8ef0002ea81ea76bec772828ffeb070ea9f
7
- data.tar.gz: c83a808c3bf61561ab23e245ddffe34fdc4f53a1e65f696e69ebb87dd6616983267e7aa9c8d92fdcec3efaa2fd68eb77d33539b32e3294dc0db7d847687482c0
6
+ metadata.gz: 94142c6d9af5ba63a338c5b07ba85987b6558dfd8e4e5f66906eeaf6cc54d97f51f3d206fa08a2f88749204cec9faeabba67d8b9cdbffaa14f68f55ab8fa80c7
7
+ data.tar.gz: 25b8d0a9eac8eae2b6a58b406112a1eedf95d7deb5e4871f63386ef91fc41994554dbb4678f9e2ab6090e47258231c8ba7189026d981c0df9e9b696e35c6e959
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  A Ruby wrapper for the Church Community Builder API (https://support.churchcommunitybuilder.com/customer/portal/articles/640589-api-documentation)
4
4
 
5
+ https://designccb.s3.amazonaws.com/helpdesk/files/official_docs/api.html
5
6
 
6
7
  ## Install / Setup
7
8
 
@@ -3,7 +3,7 @@ require "base64"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "church_community_builder"
6
- s.version = "0.0.11"
6
+ s.version = "0.0.12"
7
7
  s.authors = ['Taylor Brooks']
8
8
  s.email = ["dGJyb29rc0BnbWFpbC5jb20="].map{ |e| Base64.decode64(e) }
9
9
  s.homepage = "https://github.com/taylorbrooks/church_community_builder"
@@ -4,7 +4,7 @@ module ChurchCommunityBuilder
4
4
 
5
5
  def list_campuses
6
6
  response = get("?srv=campus_list")
7
- ::Campus.new(response).parse
7
+ ChurchCommunityBuilder::Campus.new(response).parse
8
8
  end
9
9
 
10
10
  end
@@ -4,7 +4,7 @@ module ChurchCommunityBuilder
4
4
 
5
5
  def create_contribution(contribution_params)
6
6
  response = post("?srv=online_giving_insert_gift&#{Addressable::URI.form_encode(contribution_params)}", nil)
7
- ::Contribution.new(response).parse
7
+ ChurchCommunityBuilder::Contribution.new(response).parse
8
8
  end
9
9
 
10
10
  end
@@ -4,7 +4,7 @@ module ChurchCommunityBuilder
4
4
 
5
5
  def list_funds
6
6
  response = get("?srv=transaction_detail_type_list")
7
- ::Fund.new(response).parse
7
+ ChurchCommunityBuilder::Fund.new(response).parse
8
8
  end
9
9
 
10
10
  end
@@ -4,12 +4,12 @@ module ChurchCommunityBuilder
4
4
 
5
5
  def create_person(person_params)
6
6
  response = post("?srv=create_individual", Addressable::URI.form_encode(person_params))
7
- ::Person.new(response).parse
7
+ ChurchCommunityBuilder::Person.new(response).parse
8
8
  end
9
9
 
10
10
  def search_for_person_by_email(email)
11
11
  response = get("?srv=individual_search&email=#{email}")
12
- ::Person.new(response).parse
12
+ ChurchCommunityBuilder::Person.new(response).parse
13
13
  end
14
14
 
15
15
  end
@@ -1,18 +1,20 @@
1
- class Campus
2
- attr_reader :response, :campuses
1
+ module ChurchCommunityBuilder
2
+ class Campus
3
+ attr_reader :response, :campuses
3
4
 
4
- def initialize(response)
5
- @response = response["ccb_api"]["response"]
6
- @campuses = @response["campuses"]["campus"]
7
- end
5
+ def initialize(response)
6
+ @response = response["ccb_api"]["response"]
7
+ @campuses = @response["campuses"]["campus"]
8
+ end
8
9
 
9
- def parse
10
- @campuses.map do |campus|
11
- OpenStruct.new(
12
- id: campus["id"],
13
- name: campus["name"]
14
- )
10
+ def parse
11
+ @campuses.map do |campus|
12
+ OpenStruct.new(
13
+ id: campus["id"],
14
+ name: campus["name"]
15
+ )
16
+ end
15
17
  end
16
- end
17
18
 
19
+ end
18
20
  end
@@ -1,16 +1,18 @@
1
- class Contribution
2
- attr_reader :response, :contribution
1
+ module ChurchCommunityBuilder
2
+ class Contribution
3
+ attr_reader :response, :contribution
3
4
 
4
- def initialize(response)
5
- @response = response["ccb_api"]["response"]
6
- @contribution = @response["items"]["item"]
7
- end
5
+ def initialize(response)
6
+ @response = response["ccb_api"]["response"]
7
+ @contribution = @response["items"]["item"]
8
+ end
8
9
 
9
- def parse
10
- OpenStruct.new(
11
- id: contribution["gift_id"],
12
- amount: contribution["amount"]
13
- )
14
- end
10
+ def parse
11
+ OpenStruct.new(
12
+ id: contribution["gift_id"],
13
+ amount: contribution["amount"]
14
+ )
15
+ end
15
16
 
17
+ end
16
18
  end
@@ -1,17 +1,19 @@
1
- class Fund
2
- attr_reader :response, :funds
1
+ module ChurchCommunityBuilder
2
+ class Fund
3
+ attr_reader :response, :funds
3
4
 
4
- def initialize(response)
5
- @response = response["ccb_api"]["response"]
6
- @funds = @response["transaction_detail_types"]["transaction_detail_type"]
7
- end
5
+ def initialize(response)
6
+ @response = response["ccb_api"]["response"]
7
+ @funds = @response["transaction_detail_types"]["transaction_detail_type"]
8
+ end
8
9
 
9
- def parse
10
- @funds.map do |fund|
11
- OpenStruct.new(
12
- id: fund["id"],
13
- name: fund["name"]
14
- )
10
+ def parse
11
+ @funds.map do |fund|
12
+ OpenStruct.new(
13
+ id: fund["id"],
14
+ name: fund["name"]
15
+ )
16
+ end
15
17
  end
16
18
  end
17
19
  end
@@ -1,29 +1,31 @@
1
- class Person
2
- attr_reader :response, :people, :count
1
+ module ChurchCommunityBuilder
2
+ class Person
3
+ attr_reader :response, :people, :count
3
4
 
4
- def initialize(response)
5
- @response = response["ccb_api"]["response"]
6
- @people = @response["individuals"]
7
- @count = @people["count"].to_i
8
- end
5
+ def initialize(response)
6
+ @response = response["ccb_api"]["response"]
7
+ @people = @response["individuals"]
8
+ @count = @people["count"].to_i
9
+ end
9
10
 
10
- def parse
11
- return [] if count == 0
11
+ def parse
12
+ return [] if count == 0
12
13
 
13
- if count == 1
14
- [hydrate(people["individual"])]
15
- else
16
- people["individual"].map{|p| hydrate(p) }
14
+ if count == 1
15
+ [hydrate(people["individual"])]
16
+ else
17
+ people["individual"].map{|p| hydrate(p) }
18
+ end
17
19
  end
18
- end
19
20
 
20
- def hydrate(person)
21
- OpenStruct.new(
22
- id: person["id"],
23
- first_name: person["first_name"],
24
- last_name: person["last_name"],
25
- email: person["email"]
26
- )
27
- end
21
+ def hydrate(person)
22
+ OpenStruct.new(
23
+ id: person["id"],
24
+ first_name: person["first_name"],
25
+ last_name: person["last_name"],
26
+ email: person["email"]
27
+ )
28
+ end
28
29
 
30
+ end
29
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: church_community_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks