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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c9e15deb31189a38346f8371f283a32f4ed3af6
4
- data.tar.gz: a9dbfa9ab441d14138ec660c5bc4c128dd64a994
3
+ metadata.gz: fc17a7e511dfc75753afbec7b3216797db69af7a
4
+ data.tar.gz: f26f2a17c0b75f186ef56202898358527e2de4b4
5
5
  SHA512:
6
- metadata.gz: fc67a52560aae31d446237384da05bf547ebea5b61cb68fe85483fd99accab7c3591aa0ce54dca92762bc2739a46bb7423c3fa4a96fdc68292626da39ea7108a
7
- data.tar.gz: e2884ce53ab2b11aac1344a9688a25599b29413c90f53b763f4622276ef7aab1c9bb413a6e7d9e1689d3438575c3411efacc8f4687f647d21d65dde722dc6f0e
6
+ metadata.gz: 5474fccf6bc23904d95f9c974528a3e994e59bbbaab6f075a95e5012e1c26f1c7fc918524c0a0db03178605428993b02b5ffdc2c8092037274c9c9c8ee836199
7
+ data.tar.gz: 183747a3791d624ce44c7330a639872cc0791ecdf7a9babf8bdd54931f0ffcd8ad0b662b45ca00cd4bc1ac8501bc19e927e3f6fcc4f6d278d8cb80d0d6996542
@@ -10,27 +10,35 @@ module Wes
10
10
  end
11
11
 
12
12
  def closed_submissions
13
- raise(ArgumentError, "ID not set for User") if id.nil?
13
+ check_for_id!
14
14
  client.get "#{routes.user}/#{id}#{routes.submissions}/closed"
15
15
  end
16
16
 
17
17
  def metadata
18
- raise(ArgumentError, "ID not set for User") if id.nil?
18
+ check_for_id!
19
19
  client.get "#{routes.user}/#{id}#{routes.metadata}"
20
20
  end
21
21
 
22
22
  def open_submissions
23
- raise(ArgumentError, "ID not set for User") if id.nil?
23
+ check_for_id!
24
24
  client.get "#{routes.user}/#{id}#{routes.submissions}/open"
25
25
  end
26
26
 
27
27
  def submissions
28
- raise(ArgumentError, "ID not set for User") if id.nil?
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
- raise(ArgumentError, "ID not set for User") if id.nil?
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
@@ -1,7 +1,7 @@
1
1
  module Wes
2
2
  module Data
3
3
  module API
4
- VERSION = "1.1.0".freeze
4
+ VERSION = "1.2.0".freeze
5
5
  end
6
6
  end
7
7
  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: 1.1.0
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-01 00:00:00.000000000 Z
11
+ date: 2016-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler