module Attend
Constants
- VERSION
Public Class Methods
register(email:, from:, to:, check_in:, check_out:, dry_run: true)
click to toggle source
# File lib/attend.rb, line 10 def self.register(email:, from:, to:, check_in:, check_out:, dry_run: true) absent_days = GetAbsentDays.new(zoho: zoho_api).call(email: email, from: from, to: to) if absent_days.empty? puts "No absent days between #{from} and #{to}" return end attendances = absent_days.map do |day| day_beginning = day.to_datetime Zoho::People::Attendance.new(email: email, check_in: day_beginning.new_offset("+#{check_in}"), check_out: day_beginning.new_offset("+#{check_out}")) end RegisterAttendances.new(zoho: zoho_api, dry_run: dry_run).call(attendances) end
Private Class Methods
zoho_api()
click to toggle source
# File lib/attend.rb, line 29 def self.zoho_api Zoho::People::API.new end