kentaa-api 0.5.0 → 0.6.0

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +23 -0
  3. data/.rubocop.yml +1 -0
  4. data/Gemfile.lock +14 -14
  5. data/README.md +64 -21
  6. data/lib/kentaa/api.rb +4 -24
  7. data/lib/kentaa/api/client.rb +24 -24
  8. data/lib/kentaa/api/config.rb +6 -3
  9. data/lib/kentaa/api/request.rb +2 -2
  10. data/lib/kentaa/api/resources/action.rb +6 -2
  11. data/lib/kentaa/api/resources/base.rb +18 -5
  12. data/lib/kentaa/api/resources/donation_form.rb +7 -3
  13. data/lib/kentaa/api/resources/list.rb +61 -3
  14. data/lib/kentaa/api/resources/performance.rb +62 -0
  15. data/lib/kentaa/api/resources/project.rb +11 -3
  16. data/lib/kentaa/api/resources/recurring_donor.rb +1 -1
  17. data/lib/kentaa/api/resources/segment.rb +15 -3
  18. data/lib/kentaa/api/resources/site.rb +3 -3
  19. data/lib/kentaa/api/{clients → resources}/sites.rb +1 -1
  20. data/lib/kentaa/api/resources/team.rb +2 -2
  21. data/lib/kentaa/api/resources/user.rb +0 -6
  22. data/lib/kentaa/api/resources/users.rb +5 -32
  23. data/lib/kentaa/api/util.rb +13 -0
  24. data/lib/kentaa/api/version.rb +1 -1
  25. metadata +6 -25
  26. data/.travis.yml +0 -11
  27. data/lib/kentaa/api/clients/actions.rb +0 -34
  28. data/lib/kentaa/api/clients/base.rb +0 -15
  29. data/lib/kentaa/api/clients/donation_forms.rb +0 -24
  30. data/lib/kentaa/api/clients/donations.rb +0 -24
  31. data/lib/kentaa/api/clients/manual_donations.rb +0 -39
  32. data/lib/kentaa/api/clients/newsletter_subscriptions.rb +0 -24
  33. data/lib/kentaa/api/clients/projects.rb +0 -24
  34. data/lib/kentaa/api/clients/recurring_donors.rb +0 -24
  35. data/lib/kentaa/api/clients/segments.rb +0 -24
  36. data/lib/kentaa/api/clients/teams.rb +0 -24
  37. data/lib/kentaa/api/clients/users.rb +0 -39
  38. data/lib/kentaa/api/finder.rb +0 -44
  39. data/lib/kentaa/api/resources/actions.rb +0 -40
  40. data/lib/kentaa/api/resources/donation_forms.rb +0 -35
  41. data/lib/kentaa/api/resources/donations.rb +0 -35
  42. data/lib/kentaa/api/resources/manual_donations.rb +0 -40
  43. data/lib/kentaa/api/resources/newsletter_subscriptions.rb +0 -35
  44. data/lib/kentaa/api/resources/projects.rb +0 -35
  45. data/lib/kentaa/api/resources/recurring_donors.rb +0 -35
  46. data/lib/kentaa/api/resources/segments.rb +0 -35
  47. data/lib/kentaa/api/resources/teams.rb +0 -35
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class Actions < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- actions.each(&block)
11
- end
12
-
13
- def create(attributes = {})
14
- action = Kentaa::Api::Resources::Action.new(config, options: options)
15
- action.save(attributes)
16
- end
17
-
18
- private
19
-
20
- def load_resource
21
- request.get("/actions", options)
22
- end
23
-
24
- def actions
25
- @actions ||= begin
26
- actions = []
27
-
28
- if data
29
- data.each do |action|
30
- actions << Kentaa::Api::Resources::Action.new(config, data: action, options: options)
31
- end
32
- end
33
-
34
- actions
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class DonationForms < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- donation_forms.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/donation-forms", options)
17
- end
18
-
19
- def donation_forms
20
- @donation_forms ||= begin
21
- donation_forms = []
22
-
23
- if data
24
- data.each do |donation_form|
25
- donation_forms << Kentaa::Api::Resources::DonationForm.new(config, data: donation_form, options: options)
26
- end
27
- end
28
-
29
- donation_forms
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class Donations < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- donations.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/donations", options)
17
- end
18
-
19
- def donations
20
- @donations ||= begin
21
- donations = []
22
-
23
- if data
24
- data.each do |donation|
25
- donations << Kentaa::Api::Resources::Donation.new(config, data: donation, options: options)
26
- end
27
- end
28
-
29
- donations
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class ManualDonations < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- manual_donations.each(&block)
11
- end
12
-
13
- def create(attributes = {})
14
- donation = Kentaa::Api::Resources::ManualDonation.new(config, options: options)
15
- donation.save(attributes)
16
- end
17
-
18
- private
19
-
20
- def load_resource
21
- request.get("/manual-donations", options)
22
- end
23
-
24
- def manual_donations
25
- @manual_donations ||= begin
26
- manual_donations = []
27
-
28
- if data
29
- data.each do |manual_donation|
30
- manual_donations << Kentaa::Api::Resources::ManualDonation.new(config, data: manual_donation, options: options)
31
- end
32
- end
33
-
34
- manual_donations
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class NewsletterSubscriptions < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- newsletter_subscriptions.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/newsletter-subscriptions", options)
17
- end
18
-
19
- def newsletter_subscriptions
20
- @newsletter_subscriptions ||= begin
21
- newsletter_subscriptions = []
22
-
23
- if data
24
- data.each do |newsletter_subscription|
25
- newsletter_subscriptions << Kentaa::Api::Resources::NewsletterSubscription.new(config, data: newsletter_subscription, options: options)
26
- end
27
- end
28
-
29
- newsletter_subscriptions
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class Projects < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- projects.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/projects", options)
17
- end
18
-
19
- def projects
20
- @projects ||= begin
21
- projects = []
22
-
23
- if data
24
- data.each do |project|
25
- projects << Kentaa::Api::Resources::Project.new(config, data: project, options: options)
26
- end
27
- end
28
-
29
- projects
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class RecurringDonors < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- recurring_donors.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/recurring-donors", options)
17
- end
18
-
19
- def recurring_donors
20
- @recurring_donors ||= begin
21
- recurring_donors = []
22
-
23
- if data
24
- data.each do |recurring_donor|
25
- recurring_donors << Kentaa::Api::Resources::RecurringDonor.new(config, data: recurring_donor, options: options)
26
- end
27
- end
28
-
29
- recurring_donors
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class Segments < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- segments.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/segments", options)
17
- end
18
-
19
- def segments
20
- @segments ||= begin
21
- segments = []
22
-
23
- if data
24
- data.each do |segment|
25
- segments << Kentaa::Api::Resources::Segment.new(config, data: segment, options: options)
26
- end
27
- end
28
-
29
- segments
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Resources
6
- class Teams < List
7
- include Enumerable
8
-
9
- def each(&block)
10
- teams.each(&block)
11
- end
12
-
13
- private
14
-
15
- def load_resource
16
- request.get("/teams", options)
17
- end
18
-
19
- def teams
20
- @teams ||= begin
21
- teams = []
22
-
23
- if data
24
- data.each do |team|
25
- teams << Kentaa::Api::Resources::Team.new(config, data: team, options: options)
26
- end
27
- end
28
-
29
- teams
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end