Method: Axlsx::Table#initialize

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

#initialize(ref, sheet, options = {}) {|_self| ... } ⇒ Table

Creates a new Table object

Parameters:

  • ref (String)

    The reference to the table data like ‘A1:G24’.

  • sheet (Worksheet)

    The sheet containing the table data.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

Yields:

  • (_self)

Yield Parameters:

  • _self (Axlsx::Table)

    the object that the method was called on



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/axlsx/workbook/worksheet/table.rb', line 26

def initialize(ref, sheet, options={})
  @ref = ref
  @sheet = sheet
  @style = nil
  @sheet.workbook.tables << self
  @name = "Table#{index+1}"
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
  yield self if block_given?
end