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
-
#get(id, only: nil, except: nil, include: nil) ⇒ Hashie::Mash
implements the interface to get a single Employee record.
-
#list(only: [], except: [], include: [], page: nil, per_page: nil) ⇒ Hashie::Mash
Implements the interface to get a list of accessible employees.
-
#subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil) ⇒ 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) ⇒ 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
#get(id, only: nil, except: nil, include: nil) ⇒ Hashie::Mash
implements the interface to get a single Employee record
32 33 34 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 32 def get(id, only: nil, except: nil, include: nil) fetch(id, only: only, except: except, include: include) end |
#list(only: [], except: [], include: [], page: nil, per_page: nil) ⇒ Hashie::Mash
Implements the interface to get a list of accessible employees.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 12 def list(only: [], except: [], include: [], page: nil, per_page: nil) params = { only: Array(only), except: Array(except), include: Array(include), page: page, per_page: per_page, } remove_empty_values_from!(params) client.get("/api/v4/employees", params) end |
#subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s subordinates
43 44 45 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 43 def subordinates(id, only: [], except: [], include: [], page: nil, per_page: nil) fetch("#{id}/subordinates", only: only, except: except, include: include, page: page, per_page: per_page) end |
#superiors(id, only: [], except: [], include: [], page: nil, per_page: nil) ⇒ Hashie::Mash
Implements the interface to get a list of the API token owner’s superiors
54 55 56 |
# File 'lib/payroll_hero/api/v4/employees.rb', line 54 def superiors(id, only: [], except: [], include: [], page: nil, per_page: nil) fetch("#{id}/superiors", only: only, except: except, include: include, page: page, per_page: per_page) end |