bobhr 0.3.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/lib/bob/{api.rb → api/api.rb} +8 -6
  4. data/lib/bob/{employee → api/employee}/documents.rb +0 -0
  5. data/lib/bob/{employee → api/employee}/equity_grants.rb +2 -1
  6. data/lib/bob/{employee → api/employee}/invites.rb +0 -0
  7. data/lib/bob/{employee → api/employee}/salaries.rb +2 -1
  8. data/lib/bob/{employee → api/employee}/trainings.rb +2 -1
  9. data/lib/bob/{employee → api/employee}/variable_payments.rb +2 -1
  10. data/lib/bob/{employees.rb → api/employees.rb} +10 -7
  11. data/lib/bob/{metadata → api/metadata}/company_fields.rb +2 -1
  12. data/lib/bob/{metadata → api/metadata}/company_lists.rb +4 -2
  13. data/lib/bob/{metadata.rb → api/metadata.rb} +0 -0
  14. data/lib/bob/{onboarding_wizards.rb → api/onboarding_wizards.rb} +2 -1
  15. data/lib/bob/api/reports.rb +26 -0
  16. data/lib/bob/api/time_off.rb +20 -0
  17. data/lib/bob/models/base.rb +15 -0
  18. data/lib/bob/models/company_field.rb +6 -0
  19. data/lib/bob/models/company_list.rb +6 -0
  20. data/lib/bob/models/employee.rb +45 -0
  21. data/lib/bob/models/equity_grant.rb +6 -0
  22. data/lib/bob/models/onboarding_wizard.rb +6 -0
  23. data/lib/bob/models/salary.rb +9 -0
  24. data/lib/bob/models/time_off.rb +21 -0
  25. data/lib/bob/models/training.rb +6 -0
  26. data/lib/bob/models/variable_payment.rb +6 -0
  27. data/lib/bob/models.rb +12 -0
  28. data/lib/bob/parsers/base_parser.rb +9 -0
  29. data/lib/bob/parsers/company_field_parser.rb +7 -0
  30. data/lib/bob/parsers/company_list_parser.rb +11 -0
  31. data/lib/bob/parsers/employee_parser.rb +11 -0
  32. data/lib/bob/parsers/equity_grant_parser.rb +7 -0
  33. data/lib/bob/parsers/onboarding_wizard_parser.rb +7 -0
  34. data/lib/bob/parsers/salary_parser.rb +7 -0
  35. data/lib/bob/parsers/time_off_parser.rb +11 -0
  36. data/lib/bob/parsers/training_parser.rb +7 -0
  37. data/lib/bob/parsers/variable_payment_parser.rb +7 -0
  38. data/lib/bob/parsers.rb +12 -0
  39. data/lib/bob/util.rb +22 -0
  40. data/lib/bob/version.rb +1 -1
  41. data/lib/bob.rb +9 -6
  42. metadata +54 -17
  43. data/lib/bob/reports.rb +0 -13
  44. data/lib/bob/time_off.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90881d623b810aaf7a5469ea86edbad348cf430961b4f166667c30931881a054
4
- data.tar.gz: bfc0f96e9a49e0c11ebeb326a006ea5a2c03dafc8b9d3ae50be63171b93abd8f
3
+ metadata.gz: 7802322c3f4a72dbd2ce8b8c91a5e9a1505c4cb597ffc599c77316b4e40a1909
4
+ data.tar.gz: a037d12cbce500ccbf53affc99eceb321481dafad72503e98681a11176b8b8b7
5
5
  SHA512:
6
- metadata.gz: c68aa05573becd8c2532b7150161c86fc32a791173ec8f63edbc4461cab734f929ee6c535d2cf10813b634958f1b6f455e22182356b15198c0a080a2a96bd1f7
7
- data.tar.gz: 18735135af683b46d6b17ac7d27f8426ee43e8815db6dfea552072d71a3e0851dd6e5c5569c939b545f5fa45abce466de5931083caa9b56796403c9d6339ca6e
6
+ metadata.gz: 2d9b871d2cb78cf68e75ca628b499237740950e95f0484c9ad1ee40ea909eccbbcad128f5730f728f01b95f832edb8e06b20cb693c27da6931bbc6ef54ab94d4
7
+ data.tar.gz: b58cb07c4851cc7d8ce37a36ff13fa99def9122efffff45cbe13054db24c6a9a4dfd4690fa4e53256ba55bfaf621e7990996f5c6126777dd64302db672d2b3ef
data/README.md CHANGED
@@ -40,6 +40,7 @@ Usage examples:
40
40
 
41
41
  Bob.access_token = 'your-access-token'
42
42
  employee = Bob::Employees.find(1)
43
+ employee.department
43
44
  employee_trainings = Bob::Employees::Trainings.all(1)
44
45
  ```
45
46
 
@@ -51,7 +52,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
51
52
 
52
53
  ## Contributing
53
54
 
54
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hibob. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/hibob/blob/master/CODE_OF_CONDUCT.md).
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lienvdsteen/hibob. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/lienvdsteen/hibob/blob/master/CODE_OF_CONDUCT.md).
55
56
 
56
57
  ## License
57
58
 
@@ -59,4 +60,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
59
60
 
60
61
  ## Code of Conduct
61
62
 
62
- Everyone interacting in the Hibob project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/hibob/blob/master/CODE_OF_CONDUCT.md).
63
+ Everyone interacting in the Hibob project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lienvdsteen/hibob/blob/master/CODE_OF_CONDUCT.md).
@@ -10,7 +10,7 @@ module Bob
10
10
  class API
11
11
  BASE_URL = 'https://api.hibob.com'
12
12
 
13
- def self.get(endpoint, params = {}, csv_response = false)
13
+ def self.get(endpoint, params = {}, csv_response: false)
14
14
  url = build_url(endpoint, params)
15
15
  response = RestClient.get(url, headers)
16
16
  return create_csv(response.body) if csv_response
@@ -56,17 +56,19 @@ module Bob
56
56
  url
57
57
  end
58
58
 
59
- private
60
-
61
59
  def self.create_csv(content)
62
- content.gsub!("\r", '').gsub!("", '')
60
+ file_name = SecureRandom.alphanumeric(15)
61
+
62
+ content.gsub!("\r", '').gsub!('', '')
63
63
  splitted = content.split("\n")
64
- CSV.open("response.csv", "wb") do |csv|
64
+ CSV.open("tmp/#{file_name}.csv", 'wb') do |csv|
65
65
  csv << splitted.shift.split(',')
66
66
  splitted.each do |row|
67
- csv << row.split(',')
67
+ csv << CSV.parse_line(row)
68
68
  end
69
69
  end
70
+
71
+ "tmp/#{file_name}.csv"
70
72
  end
71
73
  end
72
74
  end
File without changes
@@ -4,7 +4,8 @@ module Bob
4
4
  module Employee
5
5
  class EquityGrants < API
6
6
  def self.all(employee_id)
7
- get("people/#{employee_id}/equities")
7
+ response = get("people/#{employee_id}/equities")
8
+ EquityGrantParser.new(response).equity_grants
8
9
  end
9
10
 
10
11
  def self.create(employee_id, params = {})
File without changes
@@ -4,7 +4,8 @@ module Bob
4
4
  module Employee
5
5
  class Salaries < API
6
6
  def self.all(employee_id)
7
- get("people/#{employee_id}/salaries")
7
+ response = get("people/#{employee_id}/salaries")
8
+ SalaryParser.new(response).salaries
8
9
  end
9
10
 
10
11
  def self.create(employee_id, params = {})
@@ -4,7 +4,8 @@ module Bob
4
4
  module Employee
5
5
  class Trainings < API
6
6
  def self.all(employee_id)
7
- get("people/#{employee_id}/training")
7
+ response = get("people/#{employee_id}/training")
8
+ TrainingParser.new(response).trainings
8
9
  end
9
10
 
10
11
  def self.create(employee_id, params = {})
@@ -4,7 +4,8 @@ module Bob
4
4
  module Employee
5
5
  class VariablePayments < API
6
6
  def self.all(employee_id)
7
- get("people/#{employee_id}/variable")
7
+ response = get("people/#{employee_id}/variable")
8
+ VariablePaymentParser.new(response).variable_payments
8
9
  end
9
10
 
10
11
  def self.create(employee_id, params = {})
@@ -5,20 +5,23 @@ require_relative 'employee/trainings'
5
5
  require_relative 'employee/salaries'
6
6
  require_relative 'employee/equity_grants'
7
7
  require_relative 'employee/documents'
8
+ require_relative 'employee/variable_payments'
8
9
 
9
10
  module Bob
10
11
  class Employees < API
11
- def self.all(params = {})
12
- get('people', params)['employees']
12
+ def self.all(params = { includeHumanReadable: true })
13
+ response = get('people', params)
14
+ EmployeeParser.new(response).employees
13
15
  end
14
16
 
15
- def self.find(employee_id_or_email)
16
- get("people/#{employee_id_or_email}")
17
+ def self.find(employee_id_or_email, params: { includeHumanReadable: true })
18
+ response = get("people/#{employee_id_or_email}", params)
19
+ EmployeeParser.new(response).employee
17
20
  end
18
21
 
19
- def self.find_by(field:, value:)
20
- all.find do |employee|
21
- employee[field] == value
22
+ def self.find_by(field:, value:, params: { includeHumanReadable: true })
23
+ all(params).find do |employee|
24
+ employee.send(field) == value
22
25
  end
23
26
  end
24
27
 
@@ -4,7 +4,8 @@ module Bob
4
4
  module MetaData
5
5
  class CompanyFields < API
6
6
  def self.all
7
- get('company/people/fields')
7
+ response = get('company/people/fields')
8
+ CompanyFieldParser.new(response).fields
8
9
  end
9
10
 
10
11
  def self.create(params = {})
@@ -4,11 +4,13 @@ module Bob
4
4
  module MetaData
5
5
  class CompanyLists < API
6
6
  def self.all
7
- get('company/named-lists')
7
+ response = get('company/named-lists')
8
+ CompanyListParser.new(response).lists
8
9
  end
9
10
 
10
11
  def self.find(list_name)
11
- get("company/named-lists/#{list_name}")
12
+ response = get("company/named-lists/#{list_name}")
13
+ CompanyListParser.new(response).list
12
14
  end
13
15
 
14
16
  def self.add_item(list_name, params = {})
File without changes
@@ -3,7 +3,8 @@
3
3
  module Bob
4
4
  class OnboardingWizards < API
5
5
  def self.all
6
- get('onboarding/wizards')
6
+ response = get('onboarding/wizards')
7
+ OnboardingWizardParser.new(response).wizards
7
8
  end
8
9
  end
9
10
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'net/sftp'
4
+
5
+ module Bob
6
+ class Reports < API
7
+ def self.all
8
+ get('company/reports')
9
+ end
10
+
11
+ def self.read(report_id)
12
+ get("company/reports/#{report_id}/download?format=csv", {}, csv_response: true)
13
+ end
14
+
15
+ def self.sftp_upload(sftp_details:, report_id:)
16
+ file_name = read(report_id)
17
+ uri = URI.parse("sftp://#{sftp_details[:host]}")
18
+
19
+ Net::SFTP.start(uri.host, sftp_details[:user], password: sftp_details[:password]) do |sftp|
20
+ sftp.upload!(file_name, sftp_details[:remote_file_path])
21
+ end
22
+
23
+ true
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bob
4
+ class TimeOff < API
5
+ def self.all_changed_since(since)
6
+ response = get('timeoff/requests/changes', { since: since })['changes']
7
+ TimeOffParser.new({ 'outs' => response }).events
8
+ end
9
+
10
+ def self.today
11
+ response = get('timeoff/outtoday')
12
+ TimeOffParser.new(response).events
13
+ end
14
+
15
+ def self.find_for_employee(employee_id, request_id)
16
+ response = get("timeoff/employees/#{employee_id}/requests/#{request_id}")
17
+ TimeOffParser.new(response).event
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class Base
5
+ def initialize(raw)
6
+ attributes = Bob::Util.underscorize_hash(raw)
7
+
8
+ attributes.each do |k, v|
9
+ instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
10
+ self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
11
+ self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class CompanyField < Models::Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class CompanyList < Models::Base
5
+ end
6
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class Employee < Models::Base
5
+ def manager?
6
+ work.is_manager
7
+ end
8
+
9
+ def job_title
10
+ human_readable.work.title
11
+ end
12
+
13
+ def start_date
14
+ work.start_date
15
+ end
16
+
17
+ def department
18
+ work.department
19
+ end
20
+
21
+ def division
22
+ human_readable.work.custom_columns.column_1629151319875
23
+ end
24
+
25
+ def team
26
+ human_readable.work.custom_columns.column_1642024758438
27
+ end
28
+
29
+ def entity
30
+ human_readable.work.custom_columns.column_1633980105047
31
+ end
32
+
33
+ def city
34
+ address.site_city || address.city
35
+ end
36
+
37
+ def role_level
38
+ human_readable.work.custom_columns.column_1629151373898
39
+ end
40
+
41
+ def manager
42
+ work.reports_to
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class EquityGrant < Models::Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class OnboardingWizard < Models::Base
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class Salary < Models::Base
5
+ def change_reason
6
+ custom_columns.column_1629237637766
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class TimeOff < Models::Base
5
+ def employee
6
+ @employee ||= Bob::Employees.find(employee_id)
7
+ end
8
+
9
+ def parental_leave?
10
+ policy_type_display_name == 'Parental Leave'
11
+ end
12
+
13
+ def created?
14
+ change_type == 'Created'
15
+ end
16
+
17
+ def return_date
18
+ @return_date = Date.parse(end_date) + 1.day
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class Salary < Models::Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Models
4
+ class VariablePayment < Models::Base
5
+ end
6
+ end
data/lib/bob/models.rb ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'models/base'
4
+ require_relative 'models/employee'
5
+ require_relative 'models/equity_grant'
6
+ require_relative 'models/salary'
7
+ require_relative 'models/training'
8
+ require_relative 'models/variable_payment'
9
+ require_relative 'models/time_off'
10
+ require_relative 'models/company_list'
11
+ require_relative 'models/company_field'
12
+ require_relative 'models/onboarding_wizard'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class BaseParser
4
+ attr_reader :json_response
5
+
6
+ def initialize(json_response)
7
+ @json_response = json_response
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CompanyFieldParser < BaseParser
4
+ def fields
5
+ json_response.map { |attributes| Models::CompanyField.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CompanyListParser < BaseParser
4
+ def list
5
+ Models::CompanyList.new(json_response)
6
+ end
7
+
8
+ def lists
9
+ json_response.map { |_key, attributes| Models::CompanyList.new(attributes) }
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EmployeeParser < BaseParser
4
+ def employee
5
+ Models::Employee.new(json_response)
6
+ end
7
+
8
+ def employees
9
+ json_response['employees'].map { |attributes| Models::Employee.new(attributes) }
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EquityGrantParser < BaseParser
4
+ def equity_grants
5
+ json_response['values'].map { |attributes| Models::EquityGrant.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class OnboardingWizardParser < BaseParser
4
+ def wizards
5
+ json_response['values'].map { |attributes| Models::OnboardingWizard.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class SalaryParser < BaseParser
4
+ def salaries
5
+ json_response['values'].map { |attributes| Models::Salary.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class TimeOffParser < BaseParser
4
+ def event
5
+ Models::TimeOff.new(json_response)
6
+ end
7
+
8
+ def events
9
+ json_response['outs'].map { |attributes| Models::TimeOff.new(attributes) }
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class TrainingParser < BaseParser
4
+ def trainings
5
+ json_response['values'].map { |attributes| Models::Training.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariablePaymentParser < BaseParser
4
+ def variable_payments
5
+ json_response['values'].map { |attributes| Models::VariablePayment.new(attributes) }
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'parsers/base_parser'
4
+ require_relative 'parsers/employee_parser'
5
+ require_relative 'parsers/equity_grant_parser'
6
+ require_relative 'parsers/salary_parser'
7
+ require_relative 'parsers/training_parser'
8
+ require_relative 'parsers/variable_payment_parser'
9
+ require_relative 'parsers/time_off_parser'
10
+ require_relative 'parsers/company_list_parser'
11
+ require_relative 'parsers/company_field_parser'
12
+ require_relative 'parsers/onboarding_wizard_parser'
data/lib/bob/util.rb ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Credits to https://github.com/myponto/ponto-ruby/blob/master/lib/ponto/util.rb
4
+ module Bob
5
+ module Util
6
+ def self.underscorize_hash(attributes)
7
+ attributes.keys.each_with_object({}) do |key, result|
8
+ result[underscore(key)] = attributes[key]
9
+ end
10
+ end
11
+
12
+ def self.underscore(camel_cased_word)
13
+ return camel_cased_word unless camel_cased_word =~ /[A-Z-]/
14
+
15
+ word = camel_cased_word.to_s.gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
16
+ word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
17
+ word.tr!('-', '_')
18
+ word.downcase!
19
+ word
20
+ end
21
+ end
22
+ 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.3.4'
4
+ VERSION = '0.5.0'
5
5
  end
data/lib/bob.rb CHANGED
@@ -2,13 +2,16 @@
2
2
 
3
3
  require_relative 'bob/version'
4
4
  require_relative 'bob/configuration'
5
- require_relative 'bob/api'
6
- require_relative 'bob/employees'
7
- require_relative 'bob/time_off'
8
- require_relative 'bob/onboarding_wizards'
9
- require_relative 'bob/metadata'
10
- require_relative 'bob/reports'
5
+ require_relative 'bob/api/api'
6
+ require_relative 'bob/api/employees'
7
+ require_relative 'bob/api/time_off'
8
+ require_relative 'bob/api/onboarding_wizards'
9
+ require_relative 'bob/api/metadata'
10
+ require_relative 'bob/api/reports'
11
11
  require_relative 'bob/webhooks'
12
+ require_relative 'bob/models'
13
+ require_relative 'bob/parsers'
14
+ require_relative 'bob/util'
12
15
 
13
16
  module Bob
14
17
  extend Configuration
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.3.4
4
+ version: 0.5.0
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-02-15 00:00:00.000000000 Z
11
+ date: 2022-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: net-sftp
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rest-client
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -48,21 +62,44 @@ files:
48
62
  - LICENSE.txt
49
63
  - README.md
50
64
  - lib/bob.rb
51
- - lib/bob/api.rb
65
+ - lib/bob/api/api.rb
66
+ - lib/bob/api/employee/documents.rb
67
+ - lib/bob/api/employee/equity_grants.rb
68
+ - lib/bob/api/employee/invites.rb
69
+ - lib/bob/api/employee/salaries.rb
70
+ - lib/bob/api/employee/trainings.rb
71
+ - lib/bob/api/employee/variable_payments.rb
72
+ - lib/bob/api/employees.rb
73
+ - lib/bob/api/metadata.rb
74
+ - lib/bob/api/metadata/company_fields.rb
75
+ - lib/bob/api/metadata/company_lists.rb
76
+ - lib/bob/api/onboarding_wizards.rb
77
+ - lib/bob/api/reports.rb
78
+ - lib/bob/api/time_off.rb
52
79
  - lib/bob/configuration.rb
53
- - lib/bob/employee/documents.rb
54
- - lib/bob/employee/equity_grants.rb
55
- - lib/bob/employee/invites.rb
56
- - lib/bob/employee/salaries.rb
57
- - lib/bob/employee/trainings.rb
58
- - lib/bob/employee/variable_payments.rb
59
- - lib/bob/employees.rb
60
- - lib/bob/metadata.rb
61
- - lib/bob/metadata/company_fields.rb
62
- - lib/bob/metadata/company_lists.rb
63
- - lib/bob/onboarding_wizards.rb
64
- - lib/bob/reports.rb
65
- - lib/bob/time_off.rb
80
+ - lib/bob/models.rb
81
+ - lib/bob/models/base.rb
82
+ - lib/bob/models/company_field.rb
83
+ - lib/bob/models/company_list.rb
84
+ - lib/bob/models/employee.rb
85
+ - lib/bob/models/equity_grant.rb
86
+ - lib/bob/models/onboarding_wizard.rb
87
+ - lib/bob/models/salary.rb
88
+ - lib/bob/models/time_off.rb
89
+ - lib/bob/models/training.rb
90
+ - lib/bob/models/variable_payment.rb
91
+ - lib/bob/parsers.rb
92
+ - lib/bob/parsers/base_parser.rb
93
+ - lib/bob/parsers/company_field_parser.rb
94
+ - lib/bob/parsers/company_list_parser.rb
95
+ - lib/bob/parsers/employee_parser.rb
96
+ - lib/bob/parsers/equity_grant_parser.rb
97
+ - lib/bob/parsers/onboarding_wizard_parser.rb
98
+ - lib/bob/parsers/salary_parser.rb
99
+ - lib/bob/parsers/time_off_parser.rb
100
+ - lib/bob/parsers/training_parser.rb
101
+ - lib/bob/parsers/variable_payment_parser.rb
102
+ - lib/bob/util.rb
66
103
  - lib/bob/version.rb
67
104
  - lib/bob/webhooks.rb
68
105
  - lib/bobhr.rb
@@ -86,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
123
  - !ruby/object:Gem::Version
87
124
  version: '0'
88
125
  requirements: []
89
- rubygems_version: 3.2.31
126
+ rubygems_version: 3.3.7
90
127
  signing_key:
91
128
  specification_version: 4
92
129
  summary: Ruby gem for Bob API
data/lib/bob/reports.rb DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bob
4
- class Reports < API
5
- def self.all
6
- get('company/reports')
7
- end
8
-
9
- def self.read(report_id)
10
- get("company/reports/#{report_id}/download?format=csv", {}, true)
11
- end
12
- end
13
- end
data/lib/bob/time_off.rb DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bob
4
- class TimeOff < API
5
- def self.all_changed_since(since)
6
- get('timeoff/requests/changes', { since: since })['changes']
7
- end
8
-
9
- def self.today
10
- get('timeoff/outtoday')
11
- end
12
-
13
- def self.find_for_employee(employee_id, request_id)
14
- get("timeoff/employees/#{employee_id}/requests/#{request_id}")
15
- end
16
- end
17
- end