Class: ExportTo::Exporter::Xlsx

Inherits:
Struct
  • Object
show all
Defined in:
lib/export_to/exporter/xlsx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rowsObject

Returns the value of attribute rows

Returns:

  • (Object)

    the current value of rows



3
4
5
# File 'lib/export_to/exporter/xlsx.rb', line 3

def rows
  @rows
end

Instance Method Details

#exportObject



5
6
7
8
9
10
11
12
# File 'lib/export_to/exporter/xlsx.rb', line 5

def export
  rows.each! do |columns, model, x|
    worksheet.set_row(x, height, nil) if x > 0
    worksheet.write_row(x, columns)
  end

  workbook.read_string
end