Sha256: ba40f5bcc78cd885b8fbec0c36912210031dcf9fcaa332fcfb4880f41cc3312c
Contents?: true
Size: 1015 Bytes
Versions: 40
Compression:
Stored size: 1015 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Class for parsing `spTree` tag class ShapeTree < OOXMLDocumentObject # @return [Array] elements of shape tree attr_reader :elements def initialize(parent: nil) @elements = [] super end # Parse ShapeTree object # @param node [Nokogiri::XML:Element] node to parse # @return [ShapeTree] result of parsing def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'sp' @elements << DocxShape.new(parent: self).parse(node_child).dup when 'pic' @elements << DocxPicture.new(parent: self).parse(node_child) when 'graphicFrame' @elements << GraphicFrame.new(parent: self).parse(node_child) when 'grpSp' @elements << ShapesGrouping.new(parent: self).parse(node_child) when 'cxnSp' @elements << ConnectionShape.new(parent: self).parse(node_child) end end self end end end
Version data entries
40 entries across 40 versions & 1 rubygems