bobhr 0.5.2 → 0.5.5

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: 3b0bf74cdd6568f0a8e6cb6ce99e9c988926fdcd7ec82ff9a268f1a96798836f
4
- data.tar.gz: 4fce330ba37ef3ec5f7961bd4b7f37cc86e369269b27b6b3a38f6f1dee2ff6b9
3
+ metadata.gz: ae33057b40776c2a9e2fdb50c605eba7637b19513773ec845739559b20e40a48
4
+ data.tar.gz: 2811a2aee737af28f3d99b114876c3d3c6d6340cdf24cf3e0b55394577a98f48
5
5
  SHA512:
6
- metadata.gz: c2b7e2971d9ab457c6df69420a7d2e6a2c93761fdd39ad17200f9d02964e84e5e8f802142fd116dc8e38bf7738576a6c8e680595f3e6c8814131587e1a7f4c52
7
- data.tar.gz: 905aef3136da6b26f180c62e573044cfa43ef12d1c085888b7d968d12a8861aff3d8c422f4b0861a53160649940677360ca5225fe88a6c826bfa3fac7b2c6201
6
+ metadata.gz: 6ad2fa72340993973e17a3a7f54b1645f69155e77f3eaebf12b02be2f55a0b746d36a273b727e843c27fdef1f4c793d50f2fa77fe96ae1062a57cdd3a1e9ac76
7
+ data.tar.gz: 70f66303751bf9d6492e849625e7e0b58f03f6721b92042d7cdbd8127e29b71753e33f4ac2a0e22fc412691d343ac1caa198e8d0fb5179060a9963d26f20abdd
@@ -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
@@ -20,6 +20,8 @@ module Bob
20
20
  sftp.upload!(file_name, sftp_details[:remote_file_path])
21
21
  end
22
22
 
23
+ File.delete(file_name)
24
+
23
25
  true
24
26
  end
25
27
  end
@@ -38,8 +38,36 @@ 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
44
72
  end
45
73
  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.2'
4
+ VERSION = '0.5.5'
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.2
4
+ version: 0.5.5
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-08 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json