Class: NtqExcelsior::MultiWorkbookExporter
- Inherits:
-
Object
- Object
- NtqExcelsior::MultiWorkbookExporter
- Defined in:
- lib/ntq_excelsior/multi_workbook_exporter.rb
Instance Attribute Summary collapse
-
#exporters ⇒ Object
Returns the value of attribute exporters.
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(exporters = []) ⇒ MultiWorkbookExporter
constructor
A new instance of MultiWorkbookExporter.
Constructor Details
#initialize(exporters = []) ⇒ MultiWorkbookExporter
Returns a new instance of MultiWorkbookExporter.
8 9 10 |
# File 'lib/ntq_excelsior/multi_workbook_exporter.rb', line 8 def initialize(exporters = []) @exporters = exporters end |
Instance Attribute Details
#exporters ⇒ Object
Returns the value of attribute exporters.
6 7 8 |
# File 'lib/ntq_excelsior/multi_workbook_exporter.rb', line 6 def exporters @exporters end |
Instance Method Details
#export ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ntq_excelsior/multi_workbook_exporter.rb', line 12 def export exports = exporters exports = [exporters] if exporters && !exporters.is_a?(Array) package = Axlsx::Package.new wb = package.workbook wb_styles = wb.styles exports.each do |exporter| exporter.generate_workbook(wb, wb_styles) end package end |