Method: Axlsx::Worksheet#initialize

Defined in:
lib/axlsx/workbook/worksheet/worksheet.rb

#initialize(wb, options = {}) ⇒ Worksheet

Note:

the recommended way to manage worksheets is Workbook#add_worksheet

Creates a new worksheet.

Options Hash (options):

  • name (String)

    The name of this worksheet.

  • page_margins (Hash)

    A hash containing page margins for this worksheet. @see PageMargins

  • print_options (Hash)

    A hash containing print options for this worksheet. @see PrintOptions

  • show_gridlines (Boolean)

    indicates if gridlines should be shown for this sheet.

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 21

def initialize(wb, options={})
  self.workbook = wb
  @workbook.worksheets << self
  @sheet_protection = nil

  initialize_page_options(options)
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
end