bobhr 0.5.1 → 0.5.4

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: 7be7ee6eb8986610c73cb5b369e2ba00cdb23b1ab33762e470fe35f141ccb95e
4
- data.tar.gz: '08f8d8c2aed85d5d59bb68b269e0edbbaaa6c0d89b15613b7ed16c0b492e331f'
3
+ metadata.gz: 9e2f23eb79a6c8ff9f97d068faec100a7dfbc1ad19660dbf35d24506579a3c73
4
+ data.tar.gz: d650aac15ce41ffb4615c461eb1d4472a263c77582e114237fd442a44d90481d
5
5
  SHA512:
6
- metadata.gz: 463751142a4aaf1dd4112d38ac2f5849ff6b0228336a220ec61294e608639189674d2ef844cbc8ac6d88d4a93b6898240aadc5d01038916a79984306e0d7b6e2
7
- data.tar.gz: eea598bc6402bcf2c28ed741fcb574d395b4a617a6e1bd75194f0dd6449d22ea419b341122ac77e4753ee48d8e5904669763a71068986d6e3adb171c45354edc
6
+ metadata.gz: d0f9fe09c4605ab62d86b0bd1d624405fd9295fc536321ff371562dbbfcefe94263246f4094264a79b1f8f8013ce0ecdf7d46b112d2b9bd371c819fdc454f361
7
+ data.tar.gz: c972a2596bbfaf7c57e958f394a35a56f744c2e85dc32688ebede7aae7d30f371a8346e7cb466682b9646edbcb8bff8e8eec37ab398bd058b17a661847de9ca4
@@ -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
@@ -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/util.rb CHANGED
@@ -15,6 +15,7 @@ module Bob
15
15
  word = camel_cased_word.to_s.gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
16
16
  word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
17
17
  word.tr!('-', '_')
18
+ word.tr!(' ', '_')
18
19
  word.downcase!
19
20
  word
20
21
  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.1'
4
+ VERSION = '0.5.4'
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.1
4
+ version: 0.5.4
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-07 00:00:00.000000000 Z
11
+ date: 2022-03-16 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