taleo 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f51ad2e4166a9822e0eb73dad6e72f3311321fecd968334dbdd4618e21f39e5
4
- data.tar.gz: b1b21c16b2fa9ac17e06fd16788adf6e834709f4ecdcccafa497808cca60567b
3
+ metadata.gz: cd4fec5e0d2a14d04ab90f064af405c15898122a347e4dc6d0b91c53f2cdc28f
4
+ data.tar.gz: ef1866763aa1bfa84b10ab3aaacd927b98fc946cbc7186e63e475cce31282d92
5
5
  SHA512:
6
- metadata.gz: 51f76a10cfe521d9ca31980c51861d1bbba2529b8a045bae9bced27feafbf2917909d7f0aede0642ba46705c1a05fcd85a36f5e45d2d085bbb8249df252a2897
7
- data.tar.gz: '0032831311ab7a4a3c089173303f3ef15fe0d3ab93ac09954d3e6ea91f4206afdb0355a9fac603c3f0c752d9aba245d5ba374e20de9b6054ea9555c54386a1f6'
6
+ metadata.gz: ba23feae74468c2fadfd157d6ea0d480426348b7a748f3c170a469ad529f7642337a922e587dbf52a489d1c9db078cf690cedc704d0a0cfc571d5177870f77a2
7
+ data.tar.gz: 1c6fb9a4ec19a95cfbdade25a39c2f6db8441d4634a2c6ad20a76ef1e3e1df01040cb232fbe4c260f77aa734ce99a53f4b39f5b233b65d5118f834b862f0f080
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- taleo (0.4.0)
4
+ taleo (0.5.0)
5
5
  faraday (~> 1.0)
6
6
 
7
7
  GEM
@@ -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)
@@ -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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Taleo
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taleo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Holden