bobhr 0.5.13 → 0.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bob/api/api.rb +1 -1
- data/lib/bob/api/employees.rb +9 -0
- data/lib/bob/models/base.rb +2 -1
- data/lib/bob/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7218237ad76da3ba29c0eafa1229664858df4fc87f4fa2662b833257de0e0261
|
4
|
+
data.tar.gz: 3a10d1e11581567644956bc26bb7e2bd607bbe141fc35d2cbd5ff6f1275994fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ea339f392621c9e064ccb1b4765884b2e462c750643aacf48db743809f07d5bb64d0c89a0c4869621267bd4ad7d88c80c1f10df0f4f764544c2fd8fc32fb5e
|
7
|
+
data.tar.gz: 04abb8208e9220ecf425300c0b0db2a3fb026a9af78aa35c7af92e55b3be1cb116a419166a2e253fd958b3abfc171f31d205849e259e9ec0a0d510a7fd924c68
|
data/lib/bob/api/api.rb
CHANGED
data/lib/bob/api/employees.rb
CHANGED
@@ -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
|
data/lib/bob/models/base.rb
CHANGED
@@ -2,10 +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.instance_of?(String) && k.to_i.positive?
|
9
10
|
instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
|
10
11
|
self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
|
11
12
|
self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
|
data/lib/bob/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|