Sha256: aa459c44376475d16858f9e275658eb543ff20eb2331ea469b04e40d3294a2ff

Contents?: true

Size: 827 Bytes

Versions: 6

Compression:

Stored size: 827 Bytes

Contents

module Axlsx

  # A simple, self serializing class for storing tables
  class Tables < SimpleTypedList

    # creates a new Tables object
    def initialize(worksheet)
      raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet)
      super Table
      @worksheet = worksheet
    end

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

    # returns the relationships required by this collection
    def relationships
      return [] if empty?
      map{ |table| Relationship.new(table, TABLE_R, "../#{table.pn}") }
    end

    def to_xml_string(str = "")
      return if empty?
      str << "<tableParts count='#{size}'>"
      each { |table| str << "<tablePart r:id='#{table.rId}'/>" }
      str << '</tableParts>'
    end
  end

end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
bonio-axlsx-2.2.3 lib/axlsx/workbook/worksheet/tables.rb
bonio-axlsx-2.2.2 lib/axlsx/workbook/worksheet/tables.rb
bonio-axlsx-2.2.1 lib/axlsx/workbook/worksheet/tables.rb
dg-axlsx-2.1.0 lib/axlsx/workbook/worksheet/tables.rb
axlsx-2.1.0.pre lib/axlsx/workbook/worksheet/tables.rb
l_axlsx-2.0.1 lib/axlsx/workbook/worksheet/tables.rb