wes-data-api 4.2.0 → 4.3.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/lib/wes/data/api.rb +1 -1
- data/lib/wes/data/api/billing.rb +3 -3
- data/lib/wes/data/api/brand.rb +1 -1
- data/lib/wes/data/api/challenge.rb +6 -6
- data/lib/wes/data/api/request.rb +1 -1
- data/lib/wes/data/api/submission.rb +2 -2
- data/lib/wes/data/api/user.rb +2 -2
- data/lib/wes/data/api/video.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c086f2ba3fe42785471339e64cd50e46b325151
|
4
|
+
data.tar.gz: 149a7a0338e401c38435ccb8187bdef974fb42b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756774fe9327276bab8c5e6fa135f5d089a30dfe800e87d86642a3768931b1057d98cf798f2c22d61235b076861735ea27f2c1ad99d26d561656270f09cb2125
|
7
|
+
data.tar.gz: cb52a08709876e42cb6dcaa23aab8e582e2f645d1863400852797e71974361e13aecd1f922e714e4ce0f3c418535339a8b3278cfbbd26efc451b920d1d964382
|
data/lib/wes/data/api.rb
CHANGED
data/lib/wes/data/api/billing.rb
CHANGED
@@ -10,12 +10,12 @@ module Wes
|
|
10
10
|
|
11
11
|
def create(data)
|
12
12
|
attributes = client.post(routes.billing, data).first
|
13
|
-
model_klass.new(attributes)
|
13
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
14
14
|
end
|
15
15
|
|
16
16
|
def find(key, value)
|
17
17
|
attributes = client.get(find_route(key, value)).first
|
18
|
-
model_klass.new(attributes)
|
18
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
@@ -25,7 +25,7 @@ module Wes
|
|
25
25
|
when :id
|
26
26
|
[routes.billing, value].join("/")
|
27
27
|
when :user_id
|
28
|
-
[routes.
|
28
|
+
[routes.user, value, routes.billing].join("/")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
data/lib/wes/data/api/brand.rb
CHANGED
@@ -8,12 +8,6 @@ module Wes
|
|
8
8
|
class << self
|
9
9
|
include Base
|
10
10
|
|
11
|
-
def find(_key, value)
|
12
|
-
route = [routes.challenge, value].join("/")
|
13
|
-
attributes = client.get(route).first
|
14
|
-
model_klass.new(attributes)
|
15
|
-
end
|
16
|
-
|
17
11
|
def all(state = nil)
|
18
12
|
route = add_state(routes.challenges, state)
|
19
13
|
map_objects(
|
@@ -21,6 +15,12 @@ module Wes
|
|
21
15
|
)
|
22
16
|
end
|
23
17
|
|
18
|
+
def find(_key, value)
|
19
|
+
route = [routes.challenge, value].join("/")
|
20
|
+
attributes = client.get(route).first
|
21
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
22
|
+
end
|
23
|
+
|
24
24
|
private
|
25
25
|
|
26
26
|
def model_klass
|
data/lib/wes/data/api/request.rb
CHANGED
@@ -10,13 +10,13 @@ module Wes
|
|
10
10
|
|
11
11
|
def create(options)
|
12
12
|
attributes = client.post(routes.submission, options).first
|
13
|
-
model_klass.new(attributes)
|
13
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
14
14
|
end
|
15
15
|
|
16
16
|
def find(_key, value)
|
17
17
|
route = [routes.submission, value].join("/")
|
18
18
|
attributes = client.get(route).first
|
19
|
-
model_klass.new(attributes)
|
19
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
data/lib/wes/data/api/user.rb
CHANGED
@@ -17,12 +17,12 @@ module Wes
|
|
17
17
|
def create(id)
|
18
18
|
route = [routes.user, id].join("/")
|
19
19
|
attributes = client.post(route).first
|
20
|
-
model_klass.new(attributes)
|
20
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
21
21
|
end
|
22
22
|
|
23
23
|
def find(key, value)
|
24
24
|
attributes = client.get(find_route(key, value)).first
|
25
|
-
model_klass.new(attributes)
|
25
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
data/lib/wes/data/api/video.rb
CHANGED