class Axlsx::Package

The Package class is used to manage the Excel file in memory.

Public Instance Methods

simple(name = nil) { |sheet, predefined_styles| ... } click to toggle source

Creates a simple workbook with one sheet.

Predefines multiple styles that can be used to format cells. The sheet and styles are yielded to the provided block.

See Axlsx::Workbook#predefined_styles for a list of predefined styles.

# File lib/barkest_core/extensions/axlsx_extenstions.rb, line 19
def simple(name = nil)
  workbook.add_worksheet(name: name || 'Sheet 1') do |sheet|
    yield sheet, workbook.predefined_styles if block_given?
    sheet.add_row
  end
end