Class: PayrollHero::Api::V4::Employees
- Defined in:
- lib/payroll_hero/api/v4/employees.rb
Overview
Employees Endpoint
Instance Attribute Summary
Attributes inherited from BaseGroup
Instance Method Summary collapse
-
#convert_leaves(id, attributes) ⇒ Object
Final Pay Feature: Convert all applicable leaves to work time only,except,include and paging params don’t apply here as it’s a write call expected attributes: { leaves: [ { name: ‘Vacation’, number_of_days: 28.0 },…] }.
-
#get(id, only: nil, except: nil, include: nil, **params) ⇒ Hashie::Mash
implements the interface to get a single Employee record.
-
#list(only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of accessible employees.
-
#subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s subordinates.
-
#superiors(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s superiors.
Methods inherited from BaseGroup
Constructor Details
This class inherits a constructor from PayrollHero::Api::BaseGroup
Instance Method Details
#convert_leaves(id, attributes) ⇒ Object
Final Pay Feature: Convert all applicable leaves to work time only,except,include and paging params don’t apply here as it’s a write call expected attributes: { leaves: [ { name: ‘Vacation’, number_of_days: 28.0 },…] }
63 64 65 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 63 def convert_leaves(id, attributes) client.put "/api/v4/employees/#{id}/convert_leaves", attributes end |
#get(id, only: nil, except: nil, include: nil, **params) ⇒ Hashie::Mash
implements the interface to get a single Employee record
33 34 35 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 33 def get(id, only: nil, except: nil, include: nil, **params) fetch id, only: only, except: except, include: include, **params end |
#list(only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of accessible employees.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 12 def list(only: [], except: [], include: [], page: nil, per_page: nil, **params) combined_params = params.merge( remove_empty_values_from!( only: Array(only), except: Array(except), include: Array(include), page: page, per_page: per_page ) ) client.get "/api/v4/employees", combined_params end |
#subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s subordinates
44 45 46 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 44 def subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) fetch "#{id}/subordinates", only: only, except: except, include: include, page: page, per_page: per_page, **params end |
#superiors(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s superiors
55 56 57 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 55 def superiors(id, only: [], except: [], include: [], page: nil, per_page: nil, **params) fetch"#{id}/superiors", only: only, except: except, include: include, page: page, per_page: per_page, **params end |