bobhr 0.5.15 → 0.5.16

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: 8fbc4a2d88ccb3778bf83513c95f4606124535d1aeff8fe84732c5ebf269b6f7
4
- data.tar.gz: 4f307468c30e25e38a7b1bcc3d32c9d4689563975f4740adf9e449f97bbbe217
3
+ metadata.gz: 7218237ad76da3ba29c0eafa1229664858df4fc87f4fa2662b833257de0e0261
4
+ data.tar.gz: 3a10d1e11581567644956bc26bb7e2bd607bbe141fc35d2cbd5ff6f1275994fa
5
5
  SHA512:
6
- metadata.gz: d35199c9347fe57876644c4c674fe4a04a78160c2e20beffbfb0408534e886ed6cb4850d28758522af052271ff7e6cc2e80b864df37b17bbbbe618e34c2a8cf9
7
- data.tar.gz: 27191a97466465ca5ebf761ed6f7642e139f1777dc1e1c52ba9b4a6408b37b110993c501bda136a8c2aba444fe275eabafed5b2c5d6a2fefae73d11d1f52ff14
6
+ metadata.gz: a6ea339f392621c9e064ccb1b4765884b2e462c750643aacf48db743809f07d5bb64d0c89a0c4869621267bd4ad7d88c80c1f10df0f4f764544c2fd8fc32fb5e
7
+ data.tar.gz: 04abb8208e9220ecf425300c0b0db2a3fb026a9af78aa35c7af92e55b3be1cb116a419166a2e253fd958b3abfc171f31d205849e259e9ec0a0d510a7fd924c68
data/lib/bob/api/api.rb CHANGED
@@ -34,7 +34,7 @@ module Bob
34
34
  response.code
35
35
  end
36
36
 
37
- def self.post_file(endpoint, file_path)
37
+ def self.post_file(endpoint, file_path) # rubocop:disable Metrics/MethodLength
38
38
  url = build_url(endpoint)
39
39
  payload = {
40
40
  multipart: true,
@@ -16,6 +16,15 @@ module Bob
16
16
  EmployeeParser.new(response).employees
17
17
  end
18
18
 
19
+ def self.all_leavers(start_date:, end_date:)
20
+ all({ includeHumanReadable: true, showInactive: true }).select do |employee|
21
+ next unless employee.internal.status == 'Inactive' && employee.internal.termination_date.present?
22
+
23
+ termination_date = Date.parse(employee.internal.termination_date)
24
+ (start_date..end_date).include?(termination_date)
25
+ end
26
+ end
27
+
19
28
  def self.all_people_managers(params = { includeHumanReadable: true })
20
29
  response = get('people', params)
21
30
  EmployeeParser.new(response).managers
@@ -2,11 +2,11 @@
2
2
 
3
3
  module Models
4
4
  class Base
5
- def initialize(raw)
5
+ def initialize(raw) # rubocop:disable Metrics/AbcSize
6
6
  attributes = Bob::Util.underscorize_hash(raw)
7
7
 
8
8
  attributes.each do |k, v|
9
- k = "field_#{k}" if k.class == String && k.to_i > 0
9
+ k = "field_#{k}" if k.instance_of?(String) && k.to_i.positive?
10
10
  instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
11
11
  self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
12
12
  self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
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.15'
4
+ VERSION = '0.5.16'
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.15
4
+ version: 0.5.16
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-07-26 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.3.7
132
+ rubygems_version: 3.2.31
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Ruby gem for Bob API