Sha256: a192256b9fc0ba75a482f558a6af2375a35d75d17e9a12d86f21253b72c0baa4

Contents?: true

Size: 695 Bytes

Versions: 1

Compression:

Stored size: 695 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
caxlsx-3.2.0 lib/axlsx/workbook/worksheet/pivot_tables.rb