class Attend::RegisterAttendances

Attributes

dry_run[R]
zoho[R]

Public Class Methods

new(zoho:, dry_run: true) click to toggle source
# File lib/attend/register_attendances.rb, line 7
def initialize(zoho:, dry_run: true)
  @zoho = zoho
  @dry_run = dry_run
end

Public Instance Methods

call(attendances) click to toggle source
# File lib/attend/register_attendances.rb, line 12
def call(attendances)
  attendances.each do |attendance|
    if dry_run
      puts "DRY RUN: Committing #{attendance}"
      next
    end

    zoho.post_attendance(attendance)

    puts "Successfully registered #{attendance}"
  end
end