Class: Axlsx::PivotTables
- Inherits:
-
SimpleTypedList
- Object
- Array
- SimpleTypedList
- Axlsx::PivotTables
- Defined in:
- lib/axlsx/workbook/worksheet/pivot_tables.rb
Overview
A simple, self serializing class for storing pivot tables
Instance Attribute Summary collapse
-
#worksheet ⇒ Worksheet
readonly
The worksheet that owns this collection of pivot tables.
Instance Method Summary collapse
-
#initialize(worksheet) ⇒ PivotTables
constructor
creates a new Tables object.
-
#relationships ⇒ Object
returns the relationships required by this collection.
Constructor Details
#initialize(worksheet) ⇒ PivotTables
creates a new Tables object
7 8 9 10 11 12 |
# File 'lib/axlsx/workbook/worksheet/pivot_tables.rb', line 7 def initialize(worksheet) raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet) super(PivotTable) @worksheet = worksheet end |
Instance Attribute Details
#worksheet ⇒ Worksheet (readonly)
The worksheet that owns this collection of pivot tables
16 17 18 |
# File 'lib/axlsx/workbook/worksheet/pivot_tables.rb', line 16 def worksheet @worksheet end |
Instance Method Details
#relationships ⇒ Object
returns the relationships required by this collection
19 20 21 22 23 |
# File 'lib/axlsx/workbook/worksheet/pivot_tables.rb', line 19 def relationships return [] if empty? map { |pivot_table| Relationship.new(pivot_table, PIVOT_TABLE_R, "../#{pivot_table.pn}") } end |