Class: Axlsx::Tables
- Inherits:
-
SimpleTypedList
- Object
- SimpleTypedList
- Axlsx::Tables
- Defined in:
- lib/axlsx/workbook/worksheet/tables.rb
Overview
A simple, self serializing class for storing tables
Instance Attribute Summary collapse
-
#worksheet ⇒ Worksheet
readonly
The worksheet that owns this collection of tables.
Instance Method Summary collapse
-
#initialize(worksheet) ⇒ Tables
constructor
creates a new Tables object.
-
#relationships ⇒ Object
returns the relationships required by this collection.
-
#to_xml_string(str = "") ⇒ String
renders the tables xml.
Constructor Details
Instance Attribute Details
#worksheet ⇒ Worksheet (readonly)
The worksheet that owns this collection of tables
15 16 17 |
# File 'lib/axlsx/workbook/worksheet/tables.rb', line 15 def worksheet @worksheet end |
Instance Method Details
#relationships ⇒ Object
returns the relationships required by this collection
18 19 20 21 |
# File 'lib/axlsx/workbook/worksheet/tables.rb', line 18 def relationships return [] if empty? map{ |table| Relationship.new(table, TABLE_R, "../#{table.pn}") } end |
#to_xml_string(str = "") ⇒ String
renders the tables xml
26 27 28 29 30 31 |
# File 'lib/axlsx/workbook/worksheet/tables.rb', line 26 def to_xml_string(str = "") return if empty? str << "<tableParts count='#{size}'>" each { |table| str << "<tablePart r:id='#{table.rId}'/>" } str << '</tableParts>' end |