wes-data-api 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wes/data/api/model/submission.rb +25 -0
- data/lib/wes/data/api.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: f81a17e6bfc29c156b1a4cee8df7b17284aa0eef
|
4
|
+
data.tar.gz: 751f4000eb98fda0aa4788f0a9ff244e5cace307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36010cf1522f98e89d6e08d5edc85a840d0eb5c6f3ac82b118a8202b4b40c827e68a70d4e30a3fa87d0f43c7bad5d920c3bc6ab39cf1d19b273b4f6742d84364
|
7
|
+
data.tar.gz: caa6c09d43f708fef152e54964d0ff3da3aa83914f8f3db5806d31f39447c4d92c4eec4ee5a68d2b6ae36930984bd421185feef0602a3bc6d511d1be9915d6ae
|
@@ -6,12 +6,37 @@ module Wes
|
|
6
6
|
module API
|
7
7
|
module Model
|
8
8
|
class Submission < Base
|
9
|
+
def approve
|
10
|
+
update(state_hash("approved"))
|
11
|
+
end
|
12
|
+
|
13
|
+
def decline
|
14
|
+
update(state_hash("declined"))
|
15
|
+
end
|
16
|
+
|
17
|
+
def update(changes)
|
18
|
+
route = [routes.submission, id].join("/")
|
19
|
+
attributes = client.put(
|
20
|
+
route, attributes.to_h.merge(changes)
|
21
|
+
).first
|
22
|
+
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
9
26
|
def videos
|
10
27
|
route = [routes.submission, id, routes.videos].join("/")
|
11
28
|
map_objects(
|
12
29
|
client.get(route), Wes::Data::API::Model::Video
|
13
30
|
)
|
14
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def state_hash(s)
|
36
|
+
{
|
37
|
+
:state => s
|
38
|
+
}
|
39
|
+
end
|
15
40
|
end
|
16
41
|
end
|
17
42
|
end
|
data/lib/wes/data/api.rb
CHANGED