Sha256: b1dc84d27501acaf41102bd0870803208b5fe7a75021b901a2b9915f4ad7d4a3

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 Bytes

Contents

require_relative 'tab_list/presentation_tab'
module OoxmlParser
  # Class for working with `a:tabLst`
  class TabList < OOXMLDocumentObject
    # @return [Array, ParagraphTabs]
    attr_accessor :tabs_array

    def initialize(parent: nil)
      @tabs_array = []
      @parent = parent
    end

    # @return [Array, Column] accessor
    def [](key)
      @tabs_array[key]
    end

    # @return [True, False] if empty
    def empty?
      @tabs_array.empty?
    end

    # Parse Tabs data
    # @param [Nokogiri::XML:Element] node with Tabs data
    # @return [Tabs] value of Columns data
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'tab'
          @tabs_array << PresentationTab.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ooxml_parser-0.2.0 lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb