Sha256: e1b2a6a768f3fe18a7062a2ce72771d341df1c19ce9e787583bd264fa08761d8

Contents?: true

Size: 412 Bytes

Versions: 9

Compression:

Stored size: 412 Bytes

Contents

class ESV::Generator
  def initialize
    @data_rows = []
  end

  def <<(row)
    @data_rows << row
  end

  def render
    book = Spreadsheet::Workbook.new
    sheet = book.create_worksheet

    @data_rows.each_with_index do |data_row, index|
      row = sheet.row(index)
      row.push(*data_row)
    end

    content = ""
    fake_file = StringIO.new(content)
    book.write(fake_file)
    content
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
excel-esv-3.0.1 lib/esv/generator.rb
excel-esv-3.0.0 lib/esv/generator.rb
excel-esv-2.0.0 lib/esv/generator.rb
excel-esv-1.0.0 lib/esv/generator.rb
excel-esv-0.0.7 lib/esv/generator.rb
excel-esv-0.0.6 lib/esv/generator.rb
excel-esv-0.0.5 lib/esv/generator.rb
excel-esv-0.0.4 lib/esv/generator.rb
excel-esv-0.0.3 lib/esv/generator.rb