wes-data-api 13.6.1 → 13.7.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 +10 -2
- data/lib/wes/data/api/submission.rb +11 -3
- data/lib/wes/data/api.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: 06e579c9e12ef45ae9ed9a5fc1067b616a03aee8
|
4
|
+
data.tar.gz: d5635a9999a268a8ec0e9fb25b237743f17164b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff4d791937349d93dd6e984f6eaff57466c09b79fb77bdff9b4a93da09e870db84bea011c4dabd59fa5f90230b127d0c472937f0567baa3aa3b173008a500a9a
|
7
|
+
data.tar.gz: 85be5cdf2d1b9254d4b2ac387592d4f65727ba42b4df29660b7d2185bfe153f1c2216f161f2c54cd9b03317a6055e45b10c2574f6a434a2d03c548ed90e1a29c
|
@@ -6,18 +6,26 @@ module Wes
|
|
6
6
|
module API
|
7
7
|
module Model
|
8
8
|
class Submission < Base
|
9
|
-
def
|
10
|
-
update(
|
9
|
+
def accept_invite
|
10
|
+
update(invite_guid: nil, state: 'invite-accepted')
|
11
11
|
end
|
12
12
|
|
13
13
|
def approve
|
14
14
|
update(state: 'invite-accepted')
|
15
15
|
end
|
16
16
|
|
17
|
+
def complete
|
18
|
+
update(completed: true) unless @attributes.completed
|
19
|
+
end
|
20
|
+
|
17
21
|
def decline
|
18
22
|
update(state: 'declined')
|
19
23
|
end
|
20
24
|
|
25
|
+
def decline_invite
|
26
|
+
update(invite_guid: nil, state: 'invite-declined')
|
27
|
+
end
|
28
|
+
|
21
29
|
def videos(fetch: false)
|
22
30
|
records = fetch ? fetch_videos : @attributes.videos
|
23
31
|
map_objects(
|
@@ -13,14 +13,22 @@ module Wes
|
|
13
13
|
attributes.nil? ? nil : model_klass.new(attributes)
|
14
14
|
end
|
15
15
|
|
16
|
-
def find(
|
17
|
-
|
18
|
-
attributes = client.get(route).first
|
16
|
+
def find(key, value)
|
17
|
+
attributes = client.get(find_route(key, value)).first
|
19
18
|
attributes.nil? ? nil : model_klass.new(attributes)
|
20
19
|
end
|
21
20
|
|
22
21
|
private
|
23
22
|
|
23
|
+
def find_route(key, value)
|
24
|
+
case key
|
25
|
+
when :id
|
26
|
+
[routes.submission, value].join('/')
|
27
|
+
else
|
28
|
+
"#{routes.submission}?#{key}=#{value}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
def model_klass
|
25
33
|
Wes::Data::API::Model::Submission
|
26
34
|
end
|
data/lib/wes/data/api.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: 13.
|
4
|
+
version: 13.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|