Class: Axlsx::SheetData
- Inherits:
-
Object
- Object
- Axlsx::SheetData
- Defined in:
- lib/axlsx/workbook/worksheet/sheet_data.rb
Overview
This class manages the serialization of rows for worksheets
Instance Attribute Summary collapse
-
#worksheet ⇒ Object
readonly
Returns the value of attribute worksheet.
Instance Method Summary collapse
-
#initialize(worksheet) ⇒ SheetData
constructor
Creates a new SheetData object.
-
#to_xml_string(str = '') ⇒ String
Serialize the sheet data.
Constructor Details
Instance Attribute Details
#worksheet ⇒ Object (readonly)
Returns the value of attribute worksheet.
13 14 15 |
# File 'lib/axlsx/workbook/worksheet/sheet_data.rb', line 13 def worksheet @worksheet end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serialize the sheet data
18 19 20 21 22 23 24 |
# File 'lib/axlsx/workbook/worksheet/sheet_data.rb', line 18 def to_xml_string(str = '') str << '<sheetData>' worksheet.rows.each_with_index do |row, index| row.to_xml_string(index, str) end str << '</sheetData>' end |