kentaa-api 0.3.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +23 -0
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +21 -5
  5. data/Gemfile +4 -2
  6. data/Gemfile.lock +45 -32
  7. data/README.md +364 -67
  8. data/kentaa-api.gemspec +3 -3
  9. data/lib/kentaa/api.rb +9 -20
  10. data/lib/kentaa/api/client.rb +30 -18
  11. data/lib/kentaa/api/config.rb +10 -3
  12. data/lib/kentaa/api/exception.rb +9 -2
  13. data/lib/kentaa/api/request.rb +49 -5
  14. data/lib/kentaa/api/resources/action.rb +39 -15
  15. data/lib/kentaa/api/resources/activity.rb +11 -1
  16. data/lib/kentaa/api/resources/address.rb +7 -1
  17. data/lib/kentaa/api/resources/banner.rb +21 -1
  18. data/lib/kentaa/api/resources/base.rb +19 -6
  19. data/lib/kentaa/api/resources/consent.rb +7 -1
  20. data/lib/kentaa/api/resources/contact.rb +83 -0
  21. data/lib/kentaa/api/resources/donation.rb +30 -12
  22. data/lib/kentaa/api/resources/donation_form.rb +104 -0
  23. data/lib/kentaa/api/resources/error.rb +23 -0
  24. data/lib/kentaa/api/resources/list.rb +77 -2
  25. data/lib/kentaa/api/resources/location.rb +7 -1
  26. data/lib/kentaa/api/resources/manual_donation.rb +122 -0
  27. data/lib/kentaa/api/resources/newsletter_subscription.rb +16 -6
  28. data/lib/kentaa/api/resources/performance.rb +62 -0
  29. data/lib/kentaa/api/resources/photo.rb +21 -1
  30. data/lib/kentaa/api/resources/project.rb +37 -9
  31. data/lib/kentaa/api/resources/question.rb +19 -1
  32. data/lib/kentaa/api/resources/recurring_donor.rb +110 -0
  33. data/lib/kentaa/api/resources/registration_fee.rb +1 -1
  34. data/lib/kentaa/api/resources/resource.rb +43 -5
  35. data/lib/kentaa/api/resources/reward.rb +11 -1
  36. data/lib/kentaa/api/resources/segment.rb +35 -3
  37. data/lib/kentaa/api/resources/site.rb +15 -3
  38. data/lib/kentaa/api/{clients → resources}/sites.rb +2 -2
  39. data/lib/kentaa/api/resources/team.rb +22 -10
  40. data/lib/kentaa/api/resources/user.rb +16 -4
  41. data/lib/kentaa/api/resources/users.rb +5 -24
  42. data/lib/kentaa/api/resources/video.rb +21 -1
  43. data/lib/kentaa/api/response.rb +20 -2
  44. data/lib/kentaa/api/util.rb +13 -0
  45. data/lib/kentaa/api/version.rb +1 -1
  46. metadata +21 -30
  47. data/.travis.yml +0 -11
  48. data/lib/kentaa/api/clients/actions.rb +0 -21
  49. data/lib/kentaa/api/clients/all.rb +0 -26
  50. data/lib/kentaa/api/clients/base.rb +0 -15
  51. data/lib/kentaa/api/clients/donations.rb +0 -21
  52. data/lib/kentaa/api/clients/newsletter_subscriptions.rb +0 -21
  53. data/lib/kentaa/api/clients/projects.rb +0 -21
  54. data/lib/kentaa/api/clients/segments.rb +0 -21
  55. data/lib/kentaa/api/clients/teams.rb +0 -21
  56. data/lib/kentaa/api/clients/users.rb +0 -21
  57. data/lib/kentaa/api/finder.rb +0 -44
  58. data/lib/kentaa/api/resources/actions.rb +0 -37
  59. data/lib/kentaa/api/resources/donations.rb +0 -37
  60. data/lib/kentaa/api/resources/newsletter_subscriptions.rb +0 -37
  61. data/lib/kentaa/api/resources/projects.rb +0 -37
  62. data/lib/kentaa/api/resources/segments.rb +0 -37
  63. data/lib/kentaa/api/resources/teams.rb +0 -37
@@ -1,37 +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
- protected
14
-
15
- def load_resource(options)
16
- request.get("/donations", options)
17
- end
18
-
19
- private
20
-
21
- def donations
22
- @donations ||= begin
23
- donations = []
24
-
25
- if data
26
- data.each do |donation|
27
- donations << Kentaa::Api::Resources::Donation.new(config, data: donation)
28
- end
29
- end
30
-
31
- donations
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +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
- protected
14
-
15
- def load_resource(options)
16
- request.get("/newsletter-subscriptions", options)
17
- end
18
-
19
- private
20
-
21
- def newsletter_subscriptions
22
- @newsletter_subscriptions ||= begin
23
- newsletter_subscriptions = []
24
-
25
- if data
26
- data.each do |newsletter_subscription|
27
- newsletter_subscriptions << Kentaa::Api::Resources::NewsletterSubscription.new(config, data: newsletter_subscription)
28
- end
29
- end
30
-
31
- newsletter_subscriptions
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +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
- protected
14
-
15
- def load_resource(options)
16
- request.get("/projects", options)
17
- end
18
-
19
- private
20
-
21
- def projects
22
- @projects ||= begin
23
- projects = []
24
-
25
- if data
26
- data.each do |project|
27
- projects << Kentaa::Api::Resources::Project.new(config, data: project)
28
- end
29
- end
30
-
31
- projects
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +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
- protected
14
-
15
- def load_resource(options)
16
- request.get("/segments", options)
17
- end
18
-
19
- private
20
-
21
- def segments
22
- @segments ||= begin
23
- segments = []
24
-
25
- if data
26
- data.each do |segment|
27
- segments << Kentaa::Api::Resources::Segment.new(config, data: segment)
28
- end
29
- end
30
-
31
- segments
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +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
- protected
14
-
15
- def load_resource(options)
16
- request.get("/teams", options)
17
- end
18
-
19
- private
20
-
21
- def teams
22
- @teams ||= begin
23
- teams = []
24
-
25
- if data
26
- data.each do |team|
27
- teams << Kentaa::Api::Resources::Team.new(config, data: team)
28
- end
29
- end
30
-
31
- teams
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end