taleo 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/taleo/client.rb +2 -1
- data/lib/taleo/cursor.rb +12 -0
- data/lib/taleo/employee.rb +16 -0
- data/lib/taleo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd4fec5e0d2a14d04ab90f064af405c15898122a347e4dc6d0b91c53f2cdc28f
|
4
|
+
data.tar.gz: ef1866763aa1bfa84b10ab3aaacd927b98fc946cbc7186e63e475cce31282d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba23feae74468c2fadfd157d6ea0d480426348b7a748f3c170a469ad529f7642337a922e587dbf52a489d1c9db078cf690cedc704d0a0cfc571d5177870f77a2
|
7
|
+
data.tar.gz: 1c6fb9a4ec19a95cfbdade25a39c2f6db8441d4634a2c6ad20a76ef1e3e1df01040cb232fbe4c260f77aa734ce99a53f4b39f5b233b65d5118f834b862f0f080
|
data/Gemfile.lock
CHANGED
data/lib/taleo/client.rb
CHANGED
@@ -49,7 +49,8 @@ module Taleo
|
|
49
49
|
data = JSON.parse(res.body)
|
50
50
|
pagination = data.dig('response', 'pagination')
|
51
51
|
results = data.dig('response', 'searchResults')
|
52
|
-
Cursor.new(pagination, results, resource, klass, self)
|
52
|
+
cursor = Cursor.new(pagination, results, resource, klass, self)
|
53
|
+
cursor.self_page
|
53
54
|
end
|
54
55
|
|
55
56
|
def show(resource, id)
|
data/lib/taleo/cursor.rb
CHANGED
@@ -27,6 +27,18 @@ module Taleo
|
|
27
27
|
pagination.key?('previous')
|
28
28
|
end
|
29
29
|
|
30
|
+
def has_self?
|
31
|
+
pagination.key?('self')
|
32
|
+
end
|
33
|
+
|
34
|
+
def self_page
|
35
|
+
res = client.connection.get do |req|
|
36
|
+
req.url pagination.fetch('self')
|
37
|
+
end
|
38
|
+
|
39
|
+
new_cursor(res)
|
40
|
+
end
|
41
|
+
|
30
42
|
def next_page
|
31
43
|
raise Taleo::Error.new('No further results') unless has_next?
|
32
44
|
|
data/lib/taleo/employee.rb
CHANGED
@@ -33,5 +33,21 @@ module Taleo
|
|
33
33
|
has_one :candidate, Candidate
|
34
34
|
has_one :location, Location
|
35
35
|
has_many :packets, Packet, singular: 'packet', plural: 'activityPackets'
|
36
|
+
has_many :attachments, Attachment, singular: 'attachment', through: 'attachment'
|
37
|
+
|
38
|
+
# Override since employee relationship URLs will not include an
|
39
|
+
# attachments URL
|
40
|
+
def has_attachments?
|
41
|
+
true
|
42
|
+
end
|
43
|
+
|
44
|
+
# Annoying hack since the employee resource relationship URLs hash
|
45
|
+
# doesn't include an attachments link, even if there are attachments.
|
46
|
+
def relationship_urls
|
47
|
+
urls = super
|
48
|
+
urls.merge({
|
49
|
+
'attachment' => urls.fetch('historylog').gsub(/historylog$/, 'attachment')
|
50
|
+
})
|
51
|
+
end
|
36
52
|
end
|
37
53
|
end
|
data/lib/taleo/version.rb
CHANGED