Method: Axlsx::CellSerializer.string

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

.string(cell, str = '') ⇒ String

Serializes cells that are type string

Parameters:

  • cell (Cell)

    The cell that is being serialized

  • str (String) (defaults to: '')

    The string the serialized content will be appended to.

Returns:

  • (String)


116
117
118
119
120
121
122
123
124
125
126
# File 'lib/axlsx/workbook/worksheet/cell_serializer.rb', line 116

def string(cell, str='')
  if cell.is_array_formula?
    array_formula_serialization cell, str
  elsif cell.is_formula?
    formula_serialization cell, str
  elsif !cell.ssti.nil?
    value_serialization 's', cell.ssti, str
  else
    inline_string_serialization cell, str
  end
end