Method: Axlsx::SharedStringsTable#initialize

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

#initialize(cells) ⇒ SharedStringsTable

Creates a new Shared Strings Table agains an array of cells

Parameters:

  • cells (Array)

    This is an array of all of the cells in the workbook



31
32
33
34
35
36
37
38
# File 'lib/axlsx/workbook/shared_strings_table.rb', line 31

def initialize(cells)
  @index = 0
  @unique_cells = {}
  @shared_xml_string = ""
  shareable_cells = cells.flatten.select{ |cell| cell.plain_string? }
  @count = shareable_cells.size
  resolve(shareable_cells)
end