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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +23 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +21 -5
- data/Gemfile +4 -2
- data/Gemfile.lock +45 -32
- data/README.md +364 -67
- data/kentaa-api.gemspec +3 -3
- data/lib/kentaa/api.rb +9 -20
- data/lib/kentaa/api/client.rb +30 -18
- data/lib/kentaa/api/config.rb +10 -3
- data/lib/kentaa/api/exception.rb +9 -2
- data/lib/kentaa/api/request.rb +49 -5
- data/lib/kentaa/api/resources/action.rb +39 -15
- data/lib/kentaa/api/resources/activity.rb +11 -1
- data/lib/kentaa/api/resources/address.rb +7 -1
- data/lib/kentaa/api/resources/banner.rb +21 -1
- data/lib/kentaa/api/resources/base.rb +19 -6
- data/lib/kentaa/api/resources/consent.rb +7 -1
- data/lib/kentaa/api/resources/contact.rb +83 -0
- data/lib/kentaa/api/resources/donation.rb +30 -12
- data/lib/kentaa/api/resources/donation_form.rb +104 -0
- data/lib/kentaa/api/resources/error.rb +23 -0
- data/lib/kentaa/api/resources/list.rb +77 -2
- data/lib/kentaa/api/resources/location.rb +7 -1
- data/lib/kentaa/api/resources/manual_donation.rb +122 -0
- data/lib/kentaa/api/resources/newsletter_subscription.rb +16 -6
- data/lib/kentaa/api/resources/performance.rb +62 -0
- data/lib/kentaa/api/resources/photo.rb +21 -1
- data/lib/kentaa/api/resources/project.rb +37 -9
- data/lib/kentaa/api/resources/question.rb +19 -1
- data/lib/kentaa/api/resources/recurring_donor.rb +110 -0
- data/lib/kentaa/api/resources/registration_fee.rb +1 -1
- data/lib/kentaa/api/resources/resource.rb +43 -5
- data/lib/kentaa/api/resources/reward.rb +11 -1
- data/lib/kentaa/api/resources/segment.rb +35 -3
- data/lib/kentaa/api/resources/site.rb +15 -3
- data/lib/kentaa/api/{clients → resources}/sites.rb +2 -2
- data/lib/kentaa/api/resources/team.rb +22 -10
- data/lib/kentaa/api/resources/user.rb +16 -4
- data/lib/kentaa/api/resources/users.rb +5 -24
- data/lib/kentaa/api/resources/video.rb +21 -1
- data/lib/kentaa/api/response.rb +20 -2
- data/lib/kentaa/api/util.rb +13 -0
- data/lib/kentaa/api/version.rb +1 -1
- metadata +21 -30
- data/.travis.yml +0 -11
- data/lib/kentaa/api/clients/actions.rb +0 -21
- data/lib/kentaa/api/clients/all.rb +0 -26
- data/lib/kentaa/api/clients/base.rb +0 -15
- data/lib/kentaa/api/clients/donations.rb +0 -21
- data/lib/kentaa/api/clients/newsletter_subscriptions.rb +0 -21
- data/lib/kentaa/api/clients/projects.rb +0 -21
- data/lib/kentaa/api/clients/segments.rb +0 -21
- data/lib/kentaa/api/clients/teams.rb +0 -21
- data/lib/kentaa/api/clients/users.rb +0 -21
- data/lib/kentaa/api/finder.rb +0 -44
- data/lib/kentaa/api/resources/actions.rb +0 -37
- data/lib/kentaa/api/resources/donations.rb +0 -37
- data/lib/kentaa/api/resources/newsletter_subscriptions.rb +0 -37
- data/lib/kentaa/api/resources/projects.rb +0 -37
- data/lib/kentaa/api/resources/segments.rb +0 -37
- 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
|