class FedenaSdk::EmployeeAttendance

Attributes

attendance_date[RW]
employee_number[RW]
half_day[RW]
leave_type[RW]
reason[RW]

Public Class Methods

create(*args) click to toggle source
# File lib/fedena_sdk/employee_attendance.rb, line 26
def self.create(*args)
  attendance = EmployeeAttendance.new *args
  attendance.save
end
destroy(employee_number, date) click to toggle source
# File lib/fedena_sdk/employee_attendance.rb, line 31
def self.destroy(employee_number, date)
  url = "/api/employee_attendances/#{employee_number}"
  params = { date: date }
  options = { params: params }
  request(:delete, url, options)
end

Public Instance Methods

attributes_hash() click to toggle source

Overrides

Calls superclass method
# File lib/fedena_sdk/employee_attendance.rb, line 39
def attributes_hash
  super.merge(leave_type_code: @leave_type)
end
employee_leave_types(_query) click to toggle source
# File lib/fedena_sdk/employee_attendance.rb, line 13
def employee_leave_types(_query)
  url = '/api/employee_leave_types'
  get(url)
end
save() click to toggle source
# File lib/fedena_sdk/employee_attendance.rb, line 18
def save
  url = '/api/employee_attendances'
  params = attributes_hash
  options = { params: params }
  hash = post(url, options)
  new hash['attendance_detail']['attendance']
end