panoptes-client 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/panoptes/client/subjects.rb +17 -0
- data/lib/panoptes/client/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: e752ecee4ee1efa079e7f52cb213e084278edd61
|
|
4
|
+
data.tar.gz: 2bee1af072eba3bb0416c1f2ae04abb6b5429673
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95513c729ebbed6c985e3ee77b37842583ce1f55bcb1ac749eb7aad5c833444144d64f71d05aa8e8664d1ff1d8514a26b0616f7e33397cfbe39d769db279c0a7
|
|
7
|
+
data.tar.gz: 3f0639d4f6a50583680efac192eb6287968277a64626c062a2f5324704c2e34c410cc8ce8e5f3b46ba09d054ae6c17d51b3560a85ed85c56f96e22f63938278f
|
data/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,23 @@ module Panoptes
|
|
|
16
16
|
response.fetch("subjects")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
# Fetch a subject given filters (including permissions)
|
|
20
|
+
#
|
|
21
|
+
# @param subject_id [Integer]
|
|
22
|
+
# @param project_id [Integer]
|
|
23
|
+
# @return nil or the subject
|
|
24
|
+
def subject(subject_id, project_id: nil)
|
|
25
|
+
query = {}
|
|
26
|
+
query[:project_id] = project_id if project_id
|
|
27
|
+
|
|
28
|
+
response = panoptes.get("/subjects/#{subject_id}", query)
|
|
29
|
+
if response.fetch('subjects', []).count > 1
|
|
30
|
+
raise StandardError.new 'Unexpectedly many subjects returned'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
response.fetch('subjects', []).fetch(0, nil)
|
|
34
|
+
end
|
|
35
|
+
|
|
19
36
|
# Retire a subject for a workflow
|
|
20
37
|
#
|
|
21
38
|
# @todo Add this endpoint to the Apiary docs and add a see-reference here.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panoptes-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marten Veldthuis
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2018-
|
|
13
|
+
date: 2018-11-21 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: faraday
|