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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66e763d164f1312c6b1807a50cdc67f030644aab
4
- data.tar.gz: c42c7ab469502abcbeea780cf63c03b5659093d2
3
+ metadata.gz: 06e579c9e12ef45ae9ed9a5fc1067b616a03aee8
4
+ data.tar.gz: d5635a9999a268a8ec0e9fb25b237743f17164b5
5
5
  SHA512:
6
- metadata.gz: 11e22b38e28aadf8a457e99aeae1deff0713d79e275ce237f55bc62895873fe7d91eb49f30b0b74a4c0bdc983e65a6420cf9be7c36f58bd70e543c4c6a9018b7
7
- data.tar.gz: e60f0380401f5881c9d7385a39ab1b1c6b21ff5d0cfb5de4287d8dfde9320561a1317a5e13fdec2e87f07d8f7c9f2c546d89b4ba3b07872b9ebea336336ecad3
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 complete
10
- update(completed: true) unless @attributes.completed
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(_key, value)
17
- route = [routes.submission, value].join('/')
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
@@ -5,7 +5,7 @@ require 'wes/data/api/configuration'
5
5
  module Wes
6
6
  module Data
7
7
  module API
8
- VERSION = '13.6.1'.freeze
8
+ VERSION = '13.7.0'.freeze
9
9
  end
10
10
  end
11
11
  end
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.6.1
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-13 00:00:00.000000000 Z
11
+ date: 2017-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler