teamtailor 0.2.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +2 -2
- data/lib/teamtailor/client.rb +14 -0
- data/lib/teamtailor/parser.rb +4 -0
- data/lib/teamtailor/parser/requisition.rb +8 -0
- data/lib/teamtailor/parser/requisition_step_verdict.rb +8 -0
- data/lib/teamtailor/relationship.rb +10 -8
- data/lib/teamtailor/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2149b16c38eaf624c87c2f06eec2acea93d0cd3e92d6b7a6322f43809c20816f
|
4
|
+
data.tar.gz: 1250d366f8bb782a3909a10768219d938d411d6ede3222153ab9873cd3c6167f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0da415942f37cc09fd8f8ea914ca78001305be8c3b9de66b9a2a215a12a489f13e0f13133661129042603d8c055428e2062b1dcabad230b7ed84be2125b937
|
7
|
+
data.tar.gz: 323f5bdd970d9bf602d87fd8822cb1c99141b0d0ae7ad9a903e639c09a078d6b03748f975ec717228818ca0728d440bd81f9104bb3676005e5859a397eb522d8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## v0.3.0 - 2020-05-18
|
4
|
+
|
5
|
+
- [BREAKING] Update `Teamtailor::Relationship` to always return multiple records
|
6
|
+
- Add `Teamtailor::Requisition` and `Client#requisitions`
|
7
|
+
- Add `Teamtailor::RequisitionStepVerdict`
|
8
|
+
- Fix accessing nested relationships on `Relationship`
|
9
|
+
|
3
10
|
## v0.2.6 - 2020-05-18
|
4
11
|
|
5
12
|
- Add `Teamtailor::PartnerResult` and `Client#partner_results`
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
teamtailor (0.
|
4
|
+
teamtailor (0.3.0)
|
5
5
|
typhoeus (~> 1.3.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
docile (1.3.2)
|
17
17
|
ethon (0.12.0)
|
18
18
|
ffi (>= 1.3.0)
|
19
|
-
ffi (1.
|
19
|
+
ffi (1.13.1)
|
20
20
|
hashdiff (1.0.1)
|
21
21
|
jaro_winkler (1.5.4)
|
22
22
|
parallel (1.19.1)
|
data/lib/teamtailor/client.rb
CHANGED
@@ -194,6 +194,20 @@ module Teamtailor
|
|
194
194
|
).call
|
195
195
|
end
|
196
196
|
|
197
|
+
def requisitions(page: 1, include: [])
|
198
|
+
Teamtailor::Request.new(
|
199
|
+
base_url: base_url,
|
200
|
+
api_token: api_token,
|
201
|
+
api_version: api_version,
|
202
|
+
path: '/v1/requisitions',
|
203
|
+
params: {
|
204
|
+
'page[number]' => page,
|
205
|
+
'page[size]' => 30,
|
206
|
+
'include' => include.join(',')
|
207
|
+
}
|
208
|
+
).call
|
209
|
+
end
|
210
|
+
|
197
211
|
private
|
198
212
|
|
199
213
|
attr_reader :base_url, :api_token, :api_version
|
data/lib/teamtailor/parser.rb
CHANGED
@@ -13,6 +13,8 @@ require 'teamtailor/parser/custom_field'
|
|
13
13
|
require 'teamtailor/parser/custom_field_value'
|
14
14
|
require 'teamtailor/parser/referral'
|
15
15
|
require 'teamtailor/parser/partner_result'
|
16
|
+
require 'teamtailor/parser/requisition'
|
17
|
+
require 'teamtailor/parser/requisition_step_verdict'
|
16
18
|
|
17
19
|
module Teamtailor
|
18
20
|
class Parser
|
@@ -36,6 +38,8 @@ module Teamtailor
|
|
36
38
|
when 'custom-field-values' then Teamtailor::CustomFieldValue.new(record, included)
|
37
39
|
when 'referrals' then Teamtailor::Referral.new(record, included)
|
38
40
|
when 'partner-results' then Teamtailor::PartnerResult.new(record, included)
|
41
|
+
when 'requisitions' then Teamtailor::Requisition.new(record, included)
|
42
|
+
when 'requisition-step-verdicts' then Teamtailor::RequisitionStepVerdict.new(record, included)
|
39
43
|
|
40
44
|
else
|
41
45
|
raise Teamtailor::UnknownResponseTypeError, record&.dig('type')
|
@@ -9,27 +9,29 @@ module Teamtailor
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def loaded?
|
12
|
-
!
|
12
|
+
!record_ids.empty?
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def records
|
16
16
|
raise Teamtailor::UnloadedRelationError unless loaded?
|
17
17
|
|
18
|
-
record_json = included.
|
19
|
-
k['id']
|
18
|
+
record_json = included.select do |k|
|
19
|
+
record_ids.include?(k['id']) && k['type'] == record_type
|
20
20
|
end
|
21
21
|
|
22
|
-
Teamtailor::Parser.parse({ 'data' => record_json })
|
22
|
+
Teamtailor::Parser.parse({ 'data' => record_json, 'included' => included })
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
26
26
|
|
27
|
-
def
|
28
|
-
relationships&.dig(relation_name, 'data'
|
27
|
+
def record_ids
|
28
|
+
data = [relationships&.dig(relation_name, 'data')].flatten.compact
|
29
|
+
data.map { |row| row['id'] }
|
29
30
|
end
|
30
31
|
|
31
32
|
def record_type
|
32
|
-
relationships&.dig(relation_name, 'data'
|
33
|
+
data = [relationships&.dig(relation_name, 'data')].flatten
|
34
|
+
data.map { |row| row['type'] }.first
|
33
35
|
end
|
34
36
|
|
35
37
|
attr_reader :relation_name, :relationships, :included
|
data/lib/teamtailor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamtailor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Ligné
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -72,6 +72,8 @@ files:
|
|
72
72
|
- lib/teamtailor/parser/partner_result.rb
|
73
73
|
- lib/teamtailor/parser/referral.rb
|
74
74
|
- lib/teamtailor/parser/reject_reason.rb
|
75
|
+
- lib/teamtailor/parser/requisition.rb
|
76
|
+
- lib/teamtailor/parser/requisition_step_verdict.rb
|
75
77
|
- lib/teamtailor/parser/stage.rb
|
76
78
|
- lib/teamtailor/parser/user.rb
|
77
79
|
- lib/teamtailor/record.rb
|
@@ -101,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
103
|
- !ruby/object:Gem::Version
|
102
104
|
version: '0'
|
103
105
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.1.2
|
105
107
|
signing_key:
|
106
108
|
specification_version: 4
|
107
109
|
summary: Library for interacting with the Teamtailor API
|