Method: Axlsx::Row#to_xml_string

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

#to_xml_string(r_index, str = '') ⇒ String

Serializes the row

Parameters:

  • r_index (Integer)

    The row index, 0 based.

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

    The string this rows xml will be appended to.

Returns:

  • (String)


88
89
90
91
92
93
94
95
# File 'lib/axlsx/workbook/worksheet/row.rb', line 88

def to_xml_string(r_index, str = '')
  serialized_tag('row', str, :r => r_index + 1) do
    tmp = '' # time / memory tradeoff, lots of calls to rubyzip costs more
             # time..
    each_with_index { |cell, c_index| cell.to_xml_string(r_index, c_index, tmp) }
    str << tmp
  end
end