Class: Defmastership::Export::XLSX::XLSXData
- Inherits:
-
Object
- Object
- Defmastership::Export::XLSX::XLSXData
- Extended by:
- Memoist
- Defined in:
- lib/defmastership/export/xlsx/formatter.rb
Overview
Encapsulate the data clump
Instance Attribute Summary collapse
-
#column_list ⇒ Object
readonly
Returns the value of attribute column_list.
Instance Method Summary collapse
-
#export_to(output_file, definitions) ⇒ Object
Build an write the exported Excel Spreasheet.
-
#initialize(formatter, workbook, doc, column_list) ⇒ XLSXData
constructor
A new instance of XLSXData.
Constructor Details
#initialize(formatter, workbook, doc, column_list) ⇒ XLSXData
Returns a new instance of XLSXData.
45 46 47 48 49 50 |
# File 'lib/defmastership/export/xlsx/formatter.rb', line 45 def initialize(formatter, workbook, doc, column_list) @formatter = formatter @workbook = workbook @doc = doc @column_list = column_list end |
Instance Attribute Details
#column_list ⇒ Object (readonly)
Returns the value of attribute column_list.
39 40 41 |
# File 'lib/defmastership/export/xlsx/formatter.rb', line 39 def column_list @column_list end |
Instance Method Details
#export_to(output_file, definitions) ⇒ Object
Build an write the exported Excel Spreasheet
56 57 58 59 60 61 62 63 64 |
# File 'lib/defmastership/export/xlsx/formatter.rb', line 56 def export_to(output_file, definitions) add_header(@formatter.header(@column_list)) definitions.each_with_index do |definition, def_index| add_row(@formatter.body(definition, @column_list), def_index + 1) end @workbook.write(output_file) end |