Class: ShiftNote::Employee
- Inherits:
-
Object
- Object
- ShiftNote::Employee
- Defined in:
- lib/shiftnote/employee.rb
Overview
An employee.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The ID of the employee.
Instance Method Summary collapse
-
#delete(convert_shifts = false) ⇒ Object
Deletes this employee Quote from the site This employee may have scheduled shifts.
-
#initialize(id: nil) ⇒ Employee
constructor
A new instance of Employee.
Constructor Details
#initialize(id: nil) ⇒ Employee
Returns a new instance of Employee.
3 4 5 |
# File 'lib/shiftnote/employee.rb', line 3 def initialize(id: nil) @id = id end |
Instance Attribute Details
#id ⇒ Integer (readonly)
Returns the ID of the employee.
8 9 10 |
# File 'lib/shiftnote/employee.rb', line 8 def id @id end |
Instance Method Details
#delete(convert_shifts = false) ⇒ Object
Deletes this employee Quote from the site
This employee may have scheduled shifts.
You can choose to have these assigned shifts converted to house shifts if they are on a published schedule, and template shifts if they are on a draft schedule.
If [false], you will have to manually reassign or delete any shifts assigned to this employee.
- true
-
will convert assigned shifts to house and template shifts.
17 18 19 20 21 22 23 24 25 |
# File 'lib/shiftnote/employee.rb', line 17 def delete(convert_shifts = false) cooki = puts cooki data = { 'EmployeeID' => @id, 'ConvertShifts' => convert_shifts, '_' => Time.now.to_i * 1000 } end |