bobhr 0.5.22 → 0.5.24

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: 65cd9f915b533cbffabb497fe9ed79d14b425bd4f97975a26600eb17f84aa5c9
4
- data.tar.gz: f0ab5138416ade30cef2c9fc2cf71b1fecba59c0cdc5341306e6e7f86b0c75cd
3
+ metadata.gz: f0fed11503d114c35194157aa7cfd55df299189521273dfb4a7e4ebe6a09d69d
4
+ data.tar.gz: c7a83ffd4690f2c886783faad031d57546305bf37cf7db33938d26c9ff7493ee
5
5
  SHA512:
6
- metadata.gz: 2b135abbcfa70dcd7cdf9d160cd989c326e596e70433d8bc098aa85073cf69c456d9efbf15331119b6b223661d5ad2af6a876b74aab078b32761dae47ecbd153
7
- data.tar.gz: 15eee4533959d1221b107c309799bba14e8790c4e9c2c9ce4f6a644d8f4c73d4c95e5a46b97f0a6c77af0c2d7ead688e2d05fbcb43a8840cbf6febcd9f24c9ed
6
+ metadata.gz: fde22ec91fff35f87730be26f4371a8f97eb7a9d9f100633f9a03e16a1999d420dc67c729065965d7d9867aabc6d3b5c8387a48397fd90fb90870011902972f3
7
+ data.tar.gz: c2aa2f2b42c9204d306589302d070c8b467e3dc6011c3e136ae7c2e9a0a0d949c2f2268ebd1600b4a64a39ea453adb5f83a555113c0d1cb4a451264d803ce8e4
data/lib/bob/api/api.rb CHANGED
@@ -10,10 +10,22 @@ module Bob
10
10
  class API
11
11
  BASE_URL = 'https://api.hibob.com'
12
12
 
13
+ MAX_RETRIES = 3
14
+
13
15
  def self.get(endpoint, params = {}, csv_response: false)
14
- url = build_url(endpoint, params)
15
- response = RestClient.get(url, authorization_header)
16
- return create_csv(response.body) if csv_response
16
+ retries = 0
17
+
18
+ begin
19
+ url = build_url(endpoint, params)
20
+ response = RestClient.get(url, authorization_header)
21
+ rescue
22
+ if (retries += 1) < MAX_RETRIES
23
+ sleep 60
24
+ retry
25
+ end
26
+ end
27
+
28
+ return create_csv(response.body) if csv_response
17
29
 
18
30
  JSON.parse(response.body)
19
31
  end
@@ -5,7 +5,7 @@ module Bob
5
5
  class EmploymentHistory < API
6
6
  def self.all(employee_id)
7
7
  response = get("people/#{employee_id}/employment")
8
- EmploymentHistoryParser.new(response).work_histories
8
+ EmploymentHistoryParser.new(response).employment_histories
9
9
  end
10
10
 
11
11
  def self.create(employee_id, params)
@@ -19,11 +19,11 @@ module Models
19
19
  end
20
20
 
21
21
  def division
22
- human_readable.work.custom_columns.column_1629151319875
22
+ human_readable.work.custom_columns&.column_1629151319875
23
23
  end
24
24
 
25
25
  def team
26
- human_readable.work.custom_columns.column_1642024758438
26
+ human_readable.work.custom_columns&.column_1642024758438
27
27
  end
28
28
 
29
29
  def entity
data/lib/bob/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bob
4
- VERSION = '0.5.22'
4
+ VERSION = '0.5.24'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bobhr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.22
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lien Van Den Steen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-07 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.3.7
137
+ rubygems_version: 3.2.31
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Ruby gem for Bob API