bobhr 0.5.3 → 0.5.6
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/employees.rb +5 -0
- data/lib/bob/models/employee.rb +32 -0
- data/lib/bob/parsers/employee_parser.rb +6 -0
- data/lib/bob/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd82730426161001e491b5231b6c352cea55a2ca26e6484d69ede72efc91b358
|
4
|
+
data.tar.gz: 7c1b2c0062c6b5c781a05c508727d6d87cf821e89eca59e541703a569e2a3f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a4a4a2c923ce1edab07ad958b1d440b5912973118f3c2b7bb7b1f57dae96a9119fb76a4622b703431874444d3f0c430321fcf2c31946c494f074e609af28b8f
|
7
|
+
data.tar.gz: 3284dbc7c578633bb45fca89843ccd85738244c20a66110b8984d0c28779708cb13802e87a7926fbb98e8c4b28012d68a29d345f13981f079dd1d1c74e443a3f
|
data/lib/bob/api/employees.rb
CHANGED
@@ -14,6 +14,11 @@ module Bob
|
|
14
14
|
EmployeeParser.new(response).employees
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.all_people_managers(params = { includeHumanReadable: true })
|
18
|
+
response = get('people', params)
|
19
|
+
EmployeeParser.new(response).managers
|
20
|
+
end
|
21
|
+
|
17
22
|
def self.find(employee_id_or_email, params: { includeHumanReadable: true })
|
18
23
|
response = get("people/#{employee_id_or_email}", params)
|
19
24
|
EmployeeParser.new(response).employee
|
data/lib/bob/models/employee.rb
CHANGED
@@ -38,8 +38,40 @@ module Models
|
|
38
38
|
human_readable.work.custom_columns.column_1629151373898
|
39
39
|
end
|
40
40
|
|
41
|
+
def has_manager?
|
42
|
+
manager.present?
|
43
|
+
end
|
44
|
+
|
41
45
|
def manager
|
42
46
|
work.reports_to
|
43
47
|
end
|
48
|
+
|
49
|
+
def has_second_level_manager?
|
50
|
+
work.second_level_manager.present?
|
51
|
+
end
|
52
|
+
|
53
|
+
def second_level_manager
|
54
|
+
@second_level_manager ||= Bob::Employees.find(work.second_level_manager)
|
55
|
+
end
|
56
|
+
|
57
|
+
def has_third_level_manager?
|
58
|
+
third_level_manager.present?
|
59
|
+
end
|
60
|
+
|
61
|
+
def third_level_manager
|
62
|
+
second_level_manager.manager
|
63
|
+
end
|
64
|
+
|
65
|
+
def has_fourth_level_manager?
|
66
|
+
second_level_manager.work.second_level_manager.present?
|
67
|
+
end
|
68
|
+
|
69
|
+
def fourth_level_manager
|
70
|
+
second_level_manager.second_level_manager
|
71
|
+
end
|
72
|
+
|
73
|
+
def cost_center
|
74
|
+
payroll.custom.field_1634476091511
|
75
|
+
end
|
44
76
|
end
|
45
77
|
end
|
@@ -8,4 +8,10 @@ class EmployeeParser < BaseParser
|
|
8
8
|
def employees
|
9
9
|
json_response['employees'].map { |attributes| Models::Employee.new(attributes) }
|
10
10
|
end
|
11
|
+
|
12
|
+
def managers
|
13
|
+
json_response['employees']
|
14
|
+
.select { |employee| employee['work']['isManager'] }
|
15
|
+
.map { |attributes| Models::Employee.new(attributes) }
|
16
|
+
end
|
11
17
|
end
|
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.6
|
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-03-
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
126
|
+
rubygems_version: 3.3.7
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Ruby gem for Bob API
|