taxa 0.1.0 → 0.1.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9326adca4c92b4369f90c78c0407bd7d2b03d01ed090dfa7de9316f433b9c075
|
4
|
+
data.tar.gz: 7d9e7ae022d84889381b95bd8176287789cef60144100d8e507f224483919675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4245d41126fbb024c57eddcb53696b4e143725980c0aa08de6b3d8068ef2bd8d393e6835c5494055c40a652c21001a419af145cabc2a2f9b36601988aa098ac
|
7
|
+
data.tar.gz: 7276d724cfb346763a9c5a2db940fa75cd1e49a221c506f8bda2f1560f2ba3a34390e047000fd564978a01f44a1ac8a6e3ed3a05544d9aebb2a8e76a352e6bdc
|
@@ -10,10 +10,9 @@ module Taxa
|
|
10
10
|
module Mrca
|
11
11
|
def mrca(ott_ids)
|
12
12
|
raise ArgumentError, 'ott_ids required' if ott_ids.nil?
|
13
|
-
raise ArgumentError, 'ott_ids expected to be an array' unless ott_ids.is_a?(Array)
|
14
13
|
|
15
14
|
url = 'https://api.opentreeoflife.org/v3/taxonomy/mrca'
|
16
|
-
response = @http_client.post(url, JSON.generate({ ott_ids: ott_ids }), 'Content-Type' => 'application/json')
|
15
|
+
response = @http_client.post(url, JSON.generate({ ott_ids: Array(ott_ids) }), 'Content-Type' => 'application/json')
|
17
16
|
JSON.parse(response.body)
|
18
17
|
end
|
19
18
|
end
|
@@ -8,20 +8,20 @@ module Taxa
|
|
8
8
|
class TNRS
|
9
9
|
# tnrs match_names api endpoint
|
10
10
|
module MatchNames
|
11
|
-
def match_names(**parameters)
|
12
|
-
names
|
13
|
-
raise ArgumentError if names.nil?
|
11
|
+
def match_names(names, **parameters)
|
12
|
+
raise ArgumentError, 'names is required' if names.nil?
|
14
13
|
|
15
14
|
context_name = parameters[:context_name]
|
16
15
|
do_approximate_matching = parameters[:do_approximate_matching] || false
|
17
16
|
include_suppressed = parameters[:include_suppressed]
|
18
17
|
|
19
18
|
payload = {
|
20
|
-
names: names,
|
19
|
+
names: Array(names),
|
21
20
|
context_name: context_name,
|
22
21
|
do_approximate_matching: do_approximate_matching,
|
23
22
|
include_suppressed: include_suppressed
|
24
|
-
}
|
23
|
+
}.compact
|
24
|
+
|
25
25
|
url = 'https://api.opentreeoflife.org/v3/tnrs/match_names'
|
26
26
|
response = @http_client.post(url, JSON.generate(payload), 'Content-Type' => 'application/json')
|
27
27
|
JSON.parse(response.body)
|
data/lib/taxa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taxa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Sherman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|