Method: Axlsx::Row#initialize

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

#initialize(worksheet, values = [], options = {}) ⇒ Row

Creates a new row. New Cell objects are created based on the values, types and style options. A new cell is created for each item in the values array. style and types options are applied as follows:

If the types option is defined and is a symbol it is applied to all the cells created.
If the types option is an array, cell types are applied by index for each cell
If the types option is not set, the cell will automatically determine its type.
If the style option is defined and is an Integer, it is applied to all cells created.
If the style option is an array, style is applied by index for each cell.
If the style option is not defined, the default style (0) is applied to each cell.

Options Hash (options):

  • values (Array)
  • types (Array, Symbol)
  • style (Array, Integer)

See Also:

  • #array_to_cells
  • Cell


29
30
31
32
33
34
# File 'lib/axlsx/workbook/worksheet/row.rb', line 29

def initialize(worksheet, values=[], options={})
  self.worksheet = worksheet
  @cells = SimpleTypedList.new Cell
  @worksheet.rows << self
  array_to_cells(values, options)
end