Class: VitableConnect::Resources::Employees
- Inherits:
-
Object
- Object
- VitableConnect::Resources::Employees
- Defined in:
- lib/vitable_connect/resources/employees.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Employees
constructor
private
A new instance of Employees.
-
#list_enrollments(employee_id, limit: nil, page: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::Enrollment>
Retrieves a paginated list of benefit enrollments for an employee.
-
#retrieve(employee_id, request_options: {}) ⇒ VitableConnect::Models::EmployeeRetrieveResponse
Retrieves detailed information for a specific employee by ID.
Constructor Details
#initialize(client:) ⇒ Employees
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Employees.
60 61 62 |
# File 'lib/vitable_connect/resources/employees.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#list_enrollments(employee_id, limit: nil, page: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::Enrollment>
Retrieves a paginated list of benefit enrollments for an employee.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vitable_connect/resources/employees.rb', line 44 def list_enrollments(employee_id, params = {}) parsed, = VitableConnect::EmployeeListEnrollmentsParams.dump_request(params) query = VitableConnect::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/employees/%1$s/enrollments", employee_id], query: query, page: VitableConnect::Internal::PageNumberPage, model: VitableConnect::Enrollment, options: ) end |
#retrieve(employee_id, request_options: {}) ⇒ VitableConnect::Models::EmployeeRetrieveResponse
Retrieves detailed information for a specific employee by ID. Returns employee details including personal information, employment status, and payroll deductions from the most recent statement period. Deductions reflect a snapshot of the current period and are replaced when a new statement is generated.
20 21 22 23 24 25 26 27 |
# File 'lib/vitable_connect/resources/employees.rb', line 20 def retrieve(employee_id, params = {}) @client.request( method: :get, path: ["v1/employees/%1$s", employee_id], model: VitableConnect::Models::EmployeeRetrieveResponse, options: params[:request_options] ) end |