Class: CSVPlusPlus::Writer::Excel

Inherits:
BaseWriter show all
Extended by:
T::Sig
Includes:
FileBackerUpper
Defined in:
lib/csv_plus_plus/writer/excel.rb

Overview

A class that can output a Template to an Excel file

Instance Attribute Summary

Attributes inherited from BaseWriter

#options, #runtime

Instance Method Summary collapse

Methods included from FileBackerUpper

#write_backup

Instance Method Details

#write(template) ⇒ Object

Write the template to an Excel file

Parameters:

  • template (Template)

    The template to write



19
20
21
22
23
24
25
26
# File 'lib/csv_plus_plus/writer/excel.rb', line 19

def write(template)
  ::CSVPlusPlus::Writer::RubyXLBuilder.new(
    input_filename: ::T.must(@options.output_filename),
    rows: template.rows,
    runtime: @runtime,
    sheet_name: @options.sheet_name
  ).build_workbook.write(@options.output_filename)
end