class Axlsx::SheetData
This class manages the serialization of rows for worksheets
Attributes
worksheet[R]
Public Class Methods
new(worksheet)
click to toggle source
Creates a new SheetData
object @param [Worksheet] worksheet The worksheet that owns this sheet data.
# File lib/axlsx/workbook/worksheet/sheet_data.rb, line 8 def initialize(worksheet) raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet) @worksheet = worksheet end
Public Instance Methods
to_xml_string(str = '')
click to toggle source
Serialize the sheet data @param [String] str the string this objects serializaton will be concacted to. @return [String]
# File lib/axlsx/workbook/worksheet/sheet_data.rb, line 18 def to_xml_string(str = '') str << '<sheetData>' worksheet.rows.each_with_index{ |row, index| row.to_xml_string(index, str) } str << '</sheetData>' end