Class: CSVPlusPlus::Writer::Excel

Inherits:
BaseWriter show all
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

Instance Method Summary collapse

Methods included from FileBackerUpper

#write_backup

Instance Method Details

#write(template) ⇒ Object

write the template to an Excel file



13
14
15
16
17
18
19
# File 'lib/csv_plus_plus/writer/excel.rb', line 13

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