Sha256: 3bd58db7855b64976ee2283fe0f16f0201a74b740611ef31e54fc31fe4fa62a9

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing `grpSp`
  class ShapesGrouping < OOXMLDocumentObject
    attr_accessor :elements, :properties

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

    # Parse ShapesGrouping object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [ShapesGrouping] result of parsing
    def parse(node)
      node.xpath('*').each do |child_node|
        case child_node.name
        when 'cxnSp'
          @elements << ConnectionShape.new(parent: self).parse(child_node)
        when 'grpSpPr'
          @properties = DocxShapeProperties.new(parent: self).parse(child_node)
        when 'pic'
          @elements << DocxPicture.new(parent: self).parse(child_node)
        when 'sp'
          @elements << DocxShape.new(parent: self).parse(child_node).dup
        when 'grpSp'
          @elements << ShapesGrouping.new(parent: self).parse(child_node)
        when 'graphicFrame'
          @elements << GraphicFrame.new(parent: self).parse(child_node)
        when 'wsp'
          @elements << DocxShape.new(parent: self).parse(child_node)
        end
      end
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.8.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.7.2 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.7.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.7.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.6.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.5.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
ooxml_parser-0.5.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb