Class: Attend::GetAbsentDays

Inherits:
Object
  • Object
show all
Defined in:
lib/attend/get_absent_days.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zoho:) ⇒ GetAbsentDays

Returns a new instance of GetAbsentDays.



7
8
9
# File 'lib/attend/get_absent_days.rb', line 7

def initialize(zoho:)
  @zoho = zoho
end

Instance Attribute Details

#zohoObject (readonly)

Returns the value of attribute zoho.



5
6
7
# File 'lib/attend/get_absent_days.rb', line 5

def zoho
  @zoho
end

Instance Method Details

#call(email:, from:, to:) ⇒ Object



11
12
13
14
15
# File 'lib/attend/get_absent_days.rb', line 11

def call(email:, from:, to:)
  attendance_report = zoho.get_attendance_report(email: email, from: from, to: to)

  attendance_report.records.select(&:missing_work?).map(&:date)
end