dmao_api 0.5.0 → 0.6.0
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/lib/dmao/api/project_participant.rb +15 -0
- data/lib/dmao/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: 1427011116088fb5a9cf9842b8edef4a7eac3525
|
|
4
|
+
data.tar.gz: 648c9e0a710e4712ba68c8125f0c1b6bc389d851
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 888a19353864df0be6ea1999d4b24cb1685c638219bf3796e635d6758535913f10959e20eff56338f5d3984e3badd976df1c13f5fdb180ee425cfb237f0c6df2
|
|
7
|
+
data.tar.gz: 76b7acea4f509291638d2ebbf61da977cb7878c0d2f7601eb1f3e96ab7c2913252aaffa36c15f08d522ae90cd94d4757c095106e6b2a417996dac665559aeda1
|
|
@@ -63,6 +63,21 @@ module DMAO
|
|
|
63
63
|
raise DMAO::API::Errors::UnsupportedQueryBySystemUUID.new
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
def self.find_project_participant project_id, participant_id
|
|
67
|
+
|
|
68
|
+
response = self.api["#{self::ENDPOINT}?project=#{project_id}&person=#{participant_id}"].get
|
|
69
|
+
|
|
70
|
+
response_data = JSON.parse(response)["data"]
|
|
71
|
+
|
|
72
|
+
raise self::NOT_FOUND_ERROR.new if response_data.length == 0
|
|
73
|
+
raise DMAO::API::Errors::InvalidResponseLength.new("Expected 1 element in response there were #{response_data.length}") if response_data.length != 1
|
|
74
|
+
|
|
75
|
+
data = response_data[0]
|
|
76
|
+
|
|
77
|
+
instance_from_api_data data
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
|
|
66
81
|
end
|
|
67
82
|
|
|
68
83
|
end
|
data/lib/dmao/api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dmao_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Robinson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-04-
|
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|