Class: FedenaSdk::EmployeeAttendance
- Inherits:
-
Object
- Object
- FedenaSdk::EmployeeAttendance
- Defined in:
- lib/fedena_sdk/employee_attendance.rb
Instance Attribute Summary collapse
-
#attendance_date ⇒ Object
Returns the value of attribute attendance_date.
-
#employee_number ⇒ Object
Returns the value of attribute employee_number.
-
#half_day ⇒ Object
Returns the value of attribute half_day.
-
#leave_type ⇒ Object
Returns the value of attribute leave_type.
-
#reason ⇒ Object
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
-
#attributes_hash ⇒ Object
Overrides.
- #employee_leave_types(_query) ⇒ Object
- #save ⇒ Object
- #search(_query) ⇒ Object
Instance Attribute Details
#attendance_date ⇒ Object
Returns the value of attribute attendance_date.
3 4 5 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 3 def attendance_date @attendance_date end |
#employee_number ⇒ Object
Returns the value of attribute employee_number.
3 4 5 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 3 def employee_number @employee_number end |
#half_day ⇒ Object
Returns the value of attribute half_day.
3 4 5 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 3 def half_day @half_day end |
#leave_type ⇒ Object
Returns the value of attribute leave_type.
3 4 5 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 3 def leave_type @leave_type end |
#reason ⇒ Object
Returns the value of attribute reason.
3 4 5 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 3 def reason @reason end |
Class Method Details
.create(*args) ⇒ Object
26 27 28 29 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 26 def self.create(*args) attendance = EmployeeAttendance.new *args attendance.save end |
.destroy(employee_number, date) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 31 def self.destroy(employee_number, date) url = "/api/employee_attendances/#{employee_number}" params = { date: date } = { params: params } request(:delete, url, ) end |
Instance Method Details
#attributes_hash ⇒ Object
Overrides
39 40 41 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 39 def attributes_hash super.merge(leave_type_code: @leave_type) end |
#employee_leave_types(_query) ⇒ Object
13 14 15 16 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 13 def employee_leave_types(_query) url = '/api/employee_leave_types' get(url) end |
#save ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 18 def save url = '/api/employee_attendances' params = attributes_hash = { params: params } hash = post(url, ) new hash['attendance_detail']['attendance'] end |
#search(_query) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fedena_sdk/employee_attendance.rb', line 5 def search(_query) url = '/api/employee_attendances' hash = get(url) hash['attendance_detail']['attendance'].map do |attendance_hash| new attendance_hash end end |