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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +23 -0
- data/.rubocop.yml +1 -0
- data/Gemfile.lock +14 -14
- data/README.md +64 -21
- data/lib/kentaa/api.rb +4 -24
- data/lib/kentaa/api/client.rb +24 -24
- data/lib/kentaa/api/config.rb +6 -3
- data/lib/kentaa/api/request.rb +2 -2
- data/lib/kentaa/api/resources/action.rb +6 -2
- data/lib/kentaa/api/resources/base.rb +18 -5
- data/lib/kentaa/api/resources/donation_form.rb +7 -3
- data/lib/kentaa/api/resources/list.rb +61 -3
- data/lib/kentaa/api/resources/performance.rb +62 -0
- data/lib/kentaa/api/resources/project.rb +11 -3
- data/lib/kentaa/api/resources/recurring_donor.rb +1 -1
- data/lib/kentaa/api/resources/segment.rb +15 -3
- data/lib/kentaa/api/resources/site.rb +3 -3
- data/lib/kentaa/api/{clients → resources}/sites.rb +1 -1
- data/lib/kentaa/api/resources/team.rb +2 -2
- data/lib/kentaa/api/resources/user.rb +0 -6
- data/lib/kentaa/api/resources/users.rb +5 -32
- data/lib/kentaa/api/util.rb +13 -0
- data/lib/kentaa/api/version.rb +1 -1
- metadata +6 -25
- data/.travis.yml +0 -11
- data/lib/kentaa/api/clients/actions.rb +0 -34
- data/lib/kentaa/api/clients/base.rb +0 -15
- data/lib/kentaa/api/clients/donation_forms.rb +0 -24
- data/lib/kentaa/api/clients/donations.rb +0 -24
- data/lib/kentaa/api/clients/manual_donations.rb +0 -39
- data/lib/kentaa/api/clients/newsletter_subscriptions.rb +0 -24
- data/lib/kentaa/api/clients/projects.rb +0 -24
- data/lib/kentaa/api/clients/recurring_donors.rb +0 -24
- data/lib/kentaa/api/clients/segments.rb +0 -24
- data/lib/kentaa/api/clients/teams.rb +0 -24
- data/lib/kentaa/api/clients/users.rb +0 -39
- data/lib/kentaa/api/finder.rb +0 -44
- data/lib/kentaa/api/resources/actions.rb +0 -40
- data/lib/kentaa/api/resources/donation_forms.rb +0 -35
- data/lib/kentaa/api/resources/donations.rb +0 -35
- data/lib/kentaa/api/resources/manual_donations.rb +0 -40
- data/lib/kentaa/api/resources/newsletter_subscriptions.rb +0 -35
- data/lib/kentaa/api/resources/projects.rb +0 -35
- data/lib/kentaa/api/resources/recurring_donors.rb +0 -35
- data/lib/kentaa/api/resources/segments.rb +0 -35
- 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
|