kentaa-api 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -1
- data/.travis.yml +5 -6
- data/Gemfile +4 -3
- data/Gemfile.lock +31 -23
- data/README.md +320 -66
- data/kentaa-api.gemspec +3 -3
- data/lib/kentaa/api.rb +6 -0
- data/lib/kentaa/api/client.rb +8 -0
- data/lib/kentaa/api/clients/actions.rb +2 -2
- data/lib/kentaa/api/clients/donation_forms.rb +24 -0
- data/lib/kentaa/api/clients/donations.rb +1 -1
- data/lib/kentaa/api/clients/manual_donations.rb +5 -5
- data/lib/kentaa/api/clients/newsletter_subscriptions.rb +1 -1
- data/lib/kentaa/api/clients/projects.rb +1 -1
- data/lib/kentaa/api/clients/recurring_donors.rb +24 -0
- data/lib/kentaa/api/clients/segments.rb +1 -1
- data/lib/kentaa/api/clients/sites.rb +1 -1
- data/lib/kentaa/api/clients/teams.rb +1 -1
- data/lib/kentaa/api/clients/users.rb +7 -2
- data/lib/kentaa/api/config.rb +4 -0
- data/lib/kentaa/api/exception.rb +5 -2
- data/lib/kentaa/api/request.rb +9 -0
- data/lib/kentaa/api/resources/action.rb +10 -6
- data/lib/kentaa/api/resources/actions.rb +2 -2
- data/lib/kentaa/api/resources/contact.rb +1 -1
- data/lib/kentaa/api/resources/donation.rb +16 -6
- data/lib/kentaa/api/resources/donation_form.rb +100 -0
- data/lib/kentaa/api/resources/donation_forms.rb +35 -0
- data/lib/kentaa/api/resources/donations.rb +1 -1
- data/lib/kentaa/api/resources/manual_donation.rb +15 -5
- data/lib/kentaa/api/resources/manual_donations.rb +2 -2
- data/lib/kentaa/api/resources/newsletter_subscription.rb +13 -3
- data/lib/kentaa/api/resources/newsletter_subscriptions.rb +1 -1
- data/lib/kentaa/api/resources/project.rb +10 -2
- data/lib/kentaa/api/resources/projects.rb +1 -1
- data/lib/kentaa/api/resources/question.rb +8 -0
- data/lib/kentaa/api/resources/recurring_donor.rb +110 -0
- data/lib/kentaa/api/resources/recurring_donors.rb +35 -0
- data/lib/kentaa/api/resources/resource.rb +6 -6
- data/lib/kentaa/api/resources/segment.rb +12 -0
- data/lib/kentaa/api/resources/segments.rb +1 -1
- data/lib/kentaa/api/resources/site.rb +4 -0
- data/lib/kentaa/api/resources/team.rb +9 -5
- data/lib/kentaa/api/resources/teams.rb +1 -1
- data/lib/kentaa/api/resources/user.rb +11 -1
- data/lib/kentaa/api/resources/users.rb +7 -2
- data/lib/kentaa/api/version.rb +1 -1
- metadata +14 -8
@@ -10,6 +10,10 @@ module Kentaa
|
|
10
10
|
"User_#{id}"
|
11
11
|
end
|
12
12
|
|
13
|
+
def site
|
14
|
+
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
|
15
|
+
end
|
16
|
+
|
13
17
|
def site_id
|
14
18
|
data[:site_id]
|
15
19
|
end
|
@@ -75,7 +79,7 @@ module Kentaa
|
|
75
79
|
end
|
76
80
|
|
77
81
|
def birthday
|
78
|
-
|
82
|
+
Date.parse(data[:birthday]) if data[:birthday]
|
79
83
|
end
|
80
84
|
|
81
85
|
def gender
|
@@ -90,6 +94,12 @@ module Kentaa
|
|
90
94
|
@consent ||= Kentaa::Api::Resources::Consent.new(data[:consent]) if data[:consent]
|
91
95
|
end
|
92
96
|
|
97
|
+
def auth(attributes)
|
98
|
+
@response = request.post("/users/auth", options, attributes)
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
93
103
|
private
|
94
104
|
|
95
105
|
def load_resource
|
@@ -11,10 +11,15 @@ module Kentaa
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def create(attributes = {})
|
14
|
-
user = Kentaa::Api::Resources::User.new(config, options)
|
14
|
+
user = Kentaa::Api::Resources::User.new(config, options: options)
|
15
15
|
user.save(attributes)
|
16
16
|
end
|
17
17
|
|
18
|
+
def auth(attributes = {})
|
19
|
+
user = Kentaa::Api::Resources::User.new(config, options: options)
|
20
|
+
user.auth(attributes)
|
21
|
+
end
|
22
|
+
|
18
23
|
private
|
19
24
|
|
20
25
|
def load_resource
|
@@ -27,7 +32,7 @@ module Kentaa
|
|
27
32
|
|
28
33
|
if data
|
29
34
|
data.each do |user|
|
30
|
-
users << Kentaa::Api::Resources::User.new(config, data: user)
|
35
|
+
users << Kentaa::Api::Resources::User.new(config, data: user, options: options)
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
data/lib/kentaa/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kentaa-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,10 +95,12 @@ files:
|
|
95
95
|
- lib/kentaa/api/client.rb
|
96
96
|
- lib/kentaa/api/clients/actions.rb
|
97
97
|
- lib/kentaa/api/clients/base.rb
|
98
|
+
- lib/kentaa/api/clients/donation_forms.rb
|
98
99
|
- lib/kentaa/api/clients/donations.rb
|
99
100
|
- lib/kentaa/api/clients/manual_donations.rb
|
100
101
|
- lib/kentaa/api/clients/newsletter_subscriptions.rb
|
101
102
|
- lib/kentaa/api/clients/projects.rb
|
103
|
+
- lib/kentaa/api/clients/recurring_donors.rb
|
102
104
|
- lib/kentaa/api/clients/segments.rb
|
103
105
|
- lib/kentaa/api/clients/sites.rb
|
104
106
|
- lib/kentaa/api/clients/teams.rb
|
@@ -116,6 +118,8 @@ files:
|
|
116
118
|
- lib/kentaa/api/resources/consent.rb
|
117
119
|
- lib/kentaa/api/resources/contact.rb
|
118
120
|
- lib/kentaa/api/resources/donation.rb
|
121
|
+
- lib/kentaa/api/resources/donation_form.rb
|
122
|
+
- lib/kentaa/api/resources/donation_forms.rb
|
119
123
|
- lib/kentaa/api/resources/donations.rb
|
120
124
|
- lib/kentaa/api/resources/error.rb
|
121
125
|
- lib/kentaa/api/resources/list.rb
|
@@ -128,6 +132,8 @@ files:
|
|
128
132
|
- lib/kentaa/api/resources/project.rb
|
129
133
|
- lib/kentaa/api/resources/projects.rb
|
130
134
|
- lib/kentaa/api/resources/question.rb
|
135
|
+
- lib/kentaa/api/resources/recurring_donor.rb
|
136
|
+
- lib/kentaa/api/resources/recurring_donors.rb
|
131
137
|
- lib/kentaa/api/resources/registration_fee.rb
|
132
138
|
- lib/kentaa/api/resources/resource.rb
|
133
139
|
- lib/kentaa/api/resources/reward.rb
|
@@ -153,14 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
159
|
requirements:
|
154
160
|
- - ">="
|
155
161
|
- !ruby/object:Gem::Version
|
156
|
-
version: 2.
|
162
|
+
version: 2.4.0
|
157
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
164
|
requirements:
|
159
165
|
- - ">="
|
160
166
|
- !ruby/object:Gem::Version
|
161
167
|
version: '0'
|
162
168
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
169
|
+
rubygems_version: 3.2.3
|
164
170
|
signing_key:
|
165
171
|
specification_version: 4
|
166
172
|
summary: Ruby library for communicating with the Kentaa API
|