Sha256: a3cfd07a0074d388214b1bc18b4e36e88e59ddd9c588aa88a8def1bcc5e73540

Contents?: true

Size: 703 Bytes

Versions: 4

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

module Axlsx
  # A simple, self serializing class for storing pivot tables
  class PivotTables < SimpleTypedList
    # creates a new Tables object
    def initialize(worksheet)
      raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet)

      super(PivotTable)
      @worksheet = worksheet
    end

    # The worksheet that owns this collection of pivot tables
    # @return [Worksheet]
    attr_reader :worksheet

    # returns the relationships required by this collection
    def relationships
      return [] if empty?

      map { |pivot_table| Relationship.new(pivot_table, PIVOT_TABLE_R, "../#{pivot_table.pn}") }
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/pivot_tables.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/pivot_tables.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/pivot_tables.rb
caxlsx-4.1.0 lib/axlsx/workbook/worksheet/pivot_tables.rb