module IdCardPrinter class EmployerCardsGenerator def initialize(pl_plan_key, layout, zip=false) @pl_plan_key = pl_plan_key @layout = layout @zip = zip end def call IdCard::PrintData.where(pl_plan_key: @pl_plan_key).destroy_all EmployerCards::DataFormatter.new(@pl_plan_key).call IdCardPrinter::PdfProcessor.new(@pl_plan_key, @layout, @zip).call end end end