Class: CSVPlusPlus::Writer::Excel
Overview
A class that can output a Template
to an Excel file
Instance Attribute Summary
Attributes inherited from Writer
Instance Method Summary collapse
-
#initialize(options, position) ⇒ Excel
constructor
A new instance of Excel.
-
#write(template) ⇒ Object
Write the
template
to an Excel file. -
#write_backup ⇒ Object
Write a backup of the current spreadsheet.
Methods included from FileBackerUpper
Constructor Details
#initialize(options, position) ⇒ Excel
Returns a new instance of Excel.
17 18 19 20 21 |
# File 'lib/csv_plus_plus/writer/excel.rb', line 17 def initialize(, position) super(position) @options = end |
Instance Method Details
#write(template) ⇒ Object
Write the template
to an Excel file
27 28 29 30 31 32 33 |
# File 'lib/csv_plus_plus/writer/excel.rb', line 27 def write(template) ::CSVPlusPlus::Writer::RubyXLBuilder.new( options: @options, position: @position, rows: template.rows ).build_workbook.write(@options.output_filename) end |
#write_backup ⇒ Object
Write a backup of the current spreadsheet.
37 38 39 |
# File 'lib/csv_plus_plus/writer/excel.rb', line 37 def write_backup backup_file(@options) end |