wes-data-api 1.1.0 → 1.2.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/user.rb +17 -5
- data/lib/wes/data/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc17a7e511dfc75753afbec7b3216797db69af7a
|
4
|
+
data.tar.gz: f26f2a17c0b75f186ef56202898358527e2de4b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5474fccf6bc23904d95f9c974528a3e994e59bbbaab6f075a95e5012e1c26f1c7fc918524c0a0db03178605428993b02b5ffdc2c8092037274c9c9c8ee836199
|
7
|
+
data.tar.gz: 183747a3791d624ce44c7330a639872cc0791ecdf7a9babf8bdd54931f0ffcd8ad0b662b45ca00cd4bc1ac8501bc19e927e3f6fcc4f6d278d8cb80d0d6996542
|
data/lib/wes/data/api/user.rb
CHANGED
@@ -10,27 +10,35 @@ module Wes
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def closed_submissions
|
13
|
-
|
13
|
+
check_for_id!
|
14
14
|
client.get "#{routes.user}/#{id}#{routes.submissions}/closed"
|
15
15
|
end
|
16
16
|
|
17
17
|
def metadata
|
18
|
-
|
18
|
+
check_for_id!
|
19
19
|
client.get "#{routes.user}/#{id}#{routes.metadata}"
|
20
20
|
end
|
21
21
|
|
22
22
|
def open_submissions
|
23
|
-
|
23
|
+
check_for_id!
|
24
24
|
client.get "#{routes.user}/#{id}#{routes.submissions}/open"
|
25
25
|
end
|
26
26
|
|
27
27
|
def submissions
|
28
|
-
|
28
|
+
check_for_id!
|
29
29
|
client.get "#{routes.user}/#{id}#{routes.submissions}"
|
30
30
|
end
|
31
31
|
|
32
|
+
def update_metadata(new_metadata)
|
33
|
+
check_for_id!
|
34
|
+
client.post(
|
35
|
+
"#{routes.user}/#{id}#{routes.metadata}",
|
36
|
+
metadata.first.to_h.merge(new_metadata)
|
37
|
+
).first
|
38
|
+
end
|
39
|
+
|
32
40
|
def videos
|
33
|
-
|
41
|
+
check_for_id!
|
34
42
|
client.get "#{routes.user}/#{id}#{routes.videos}"
|
35
43
|
end
|
36
44
|
|
@@ -38,6 +46,10 @@ module Wes
|
|
38
46
|
|
39
47
|
attr_reader :id
|
40
48
|
|
49
|
+
def check_for_id!
|
50
|
+
raise(ArgumentError, "ID not set for User") if id.nil?
|
51
|
+
end
|
52
|
+
|
41
53
|
def client
|
42
54
|
Client.new
|
43
55
|
end
|
data/lib/wes/data/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|