Sha256: 7544b8a98c3854da94f0b19c8d81d66ffe959375576532f408508dc360296a5c

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 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_R, "../#{pivot_table.pn}") }
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axlsx-1.3.6 lib/axlsx/workbook/worksheet/pivot_tables.rb
axlsx-1.3.5 lib/axlsx/workbook/worksheet/pivot_tables.rb