Sha256: 9af73154ec56fa4afa97d344f1f5aa2744bdcad44064fc0f60749a2102d205db

Contents?: true

Size: 502 Bytes

Versions: 9

Compression:

Stored size: 502 Bytes

Contents

require 'caxlsx'

module NtqExcelsior
  class MultiWorkbookExporter

    attr_accessor :exporters
  
    def initialize(exporters = [])
      @exporters = exporters
    end

    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

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ntq_excelsior-1.5.1 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.5.0 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.4.2 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.4.1 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.4.0 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.3.0 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.2.2 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.2.1 lib/ntq_excelsior/multi_workbook_exporter.rb
ntq_excelsior-1.2.0 lib/ntq_excelsior/multi_workbook_exporter.rb