Class: Defmastership::Export::XLSX::Formatter
- Defined in:
- lib/defmastership/export/xlsx/formatter.rb
Overview
to export a XSLX file
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary collapse
-
#export_to(output_file) ⇒ Object
Export the document to a XSLX file.
-
#initialize(doc, _options = {}) ⇒ Formatter
constructor
A new instance of Formatter.
Methods inherited from Formatter
Constructor Details
#initialize(doc, _options = {}) ⇒ Formatter
Returns a new instance of Formatter.
18 19 20 |
# File 'lib/defmastership/export/xlsx/formatter.rb', line 18 def initialize(doc, = {}) super(doc) end |
Instance Method Details
#export_to(output_file) ⇒ Object
Export the document to a XSLX file
25 26 27 28 29 30 31 32 |
# File 'lib/defmastership/export/xlsx/formatter.rb', line 25 def export_to(output_file) workbook = RubyXL::Workbook.new column_list = build_column_list xlsx_data = XLSXData.new(self, workbook, doc, column_list) # Delegate the entire process to the XLSXData object xlsx_data.export_to(output_file, doc.definitions) end |