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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88c30a8019f27891863ec1dd5c4c0d33f87b34e4e05d0aae049f4d4f25c6630b
4
- data.tar.gz: f7b8bfae6431f0020cf07e417e7de50f675e69c98c391cf4d34ca6c65696ff5a
3
+ metadata.gz: fd82730426161001e491b5231b6c352cea55a2ca26e6484d69ede72efc91b358
4
+ data.tar.gz: 7c1b2c0062c6b5c781a05c508727d6d87cf821e89eca59e541703a569e2a3f07
5
5
  SHA512:
6
- metadata.gz: 6608fb37aa26b5978b9f0dcc0d4b52c7ff297800cccf59fb396fdd175d73ed7acd7b1c62687fa8dbcb0291e5f30b7fd845612902472decb8ef487a64c098ae35
7
- data.tar.gz: dec4452da26aa0e1d8d70e31346af34a5657e4616bee663bfe178215126f4de56dfe73dda4727e03ad923ae0ec09b788cd229473af753d6f32a0ce0c3c2bafda
6
+ metadata.gz: 5a4a4a2c923ce1edab07ad958b1d440b5912973118f3c2b7bb7b1f57dae96a9119fb76a4622b703431874444d3f0c430321fcf2c31946c494f074e609af28b8f
7
+ data.tar.gz: 3284dbc7c578633bb45fca89843ccd85738244c20a66110b8984d0c28779708cb13802e87a7926fbb98e8c4b28012d68a29d345f13981f079dd1d1c74e443a3f
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bob
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.6'
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.3
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-14 00:00:00.000000000 Z
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.2.31
126
+ rubygems_version: 3.3.7
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Ruby gem for Bob API