bobhr 0.5.14 → 0.5.17
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/employee/time_off.rb +12 -0
- data/lib/bob/api/employees.rb +10 -0
- data/lib/bob/models/base.rb +2 -2
- data/lib/bob/parsers/base_parser.rb +4 -0
- data/lib/bob/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bfc372aea38224844d0bbb70a15fa25b688724e714836d451d39e9f543c1577
|
4
|
+
data.tar.gz: 1cabe3c271b8f048c63294a672bf15e03e20bb725d5fe8d7871785f001a42df0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15f51d9c32b5f04da13b268f7ef5b08b384fa8f62f139b555ecf1f22f218f7cd8fc2e953457b2507369e122a29cc712ab508990c3b22d4ede96c557a56556da2
|
7
|
+
data.tar.gz: 73ff2e831eb14fe256bee2016e1afab2b312536795d5b97b597cceb18d6c2ffc72ca39ddc3ee27822132a84bc73475d5c8c4a856c5d89ad0616fbd1f3280a494
|
data/lib/bob/api/api.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bob
|
4
|
+
module Employee
|
5
|
+
class TimeOff < API
|
6
|
+
def self.balance(employee_id:, policy_type:, date: )
|
7
|
+
response = get("timeoff/employees/#{employee_id}/balance", {policyType: policy_type, date: date})
|
8
|
+
BaseParser.new(response).fields
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/bob/api/employees.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative 'employee/documents'
|
|
8
8
|
require_relative 'employee/variable_payments'
|
9
9
|
require_relative 'employee/work_history'
|
10
10
|
require_relative 'employee/lifecycle_history'
|
11
|
+
require_relative 'employee/time_off'
|
11
12
|
|
12
13
|
module Bob
|
13
14
|
class Employees < API
|
@@ -16,6 +17,15 @@ module Bob
|
|
16
17
|
EmployeeParser.new(response).employees
|
17
18
|
end
|
18
19
|
|
20
|
+
def self.all_leavers(start_date:, end_date:)
|
21
|
+
all({ includeHumanReadable: true, showInactive: true }).select do |employee|
|
22
|
+
next unless employee.internal.status == 'Inactive' && employee.internal.termination_date.present?
|
23
|
+
|
24
|
+
termination_date = Date.parse(employee.internal.termination_date)
|
25
|
+
(start_date..end_date).include?(termination_date)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
19
29
|
def self.all_people_managers(params = { includeHumanReadable: true })
|
20
30
|
response = get('people', params)
|
21
31
|
EmployeeParser.new(response).managers
|
data/lib/bob/models/base.rb
CHANGED
@@ -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.
|
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
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.17
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/bob/api/employee/invites.rb
|
69
69
|
- lib/bob/api/employee/lifecycle_history.rb
|
70
70
|
- lib/bob/api/employee/salaries.rb
|
71
|
+
- lib/bob/api/employee/time_off.rb
|
71
72
|
- lib/bob/api/employee/trainings.rb
|
72
73
|
- lib/bob/api/employee/variable_payments.rb
|
73
74
|
- lib/bob/api/employee/work_history.rb
|
@@ -129,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
130
|
- !ruby/object:Gem::Version
|
130
131
|
version: '0'
|
131
132
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
133
|
+
rubygems_version: 3.2.31
|
133
134
|
signing_key:
|
134
135
|
specification_version: 4
|
135
136
|
summary: Ruby gem for Bob API
|