Sha256: efe779fefbc367a0fe3178d206e1df3586ed7095535d37cc8d900f92e45e3dbe

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

require_relative 'docx_custom_geometry/docx_shape_line_element'
require_relative 'docx_custom_geometry/docx_shape_line_path'
# Docx Custom Geometry
module OoxmlParser
  class OOXMLCustomGeometry
    attr_accessor :paths_list

    def initialize(paths_list = [])
      @paths_list = paths_list
    end

    def self.parse(custom_geometry_node)
      custom_geometry = OOXMLCustomGeometry.new
      custom_geometry_node.xpath('*').each do |custom_geometry_node_child|
        case custom_geometry_node_child.name
        when 'pathLst'
          custom_geometry_node_child.xpath('a:path', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').each { |path_node| custom_geometry.paths_list << DocxShapeLinePath.parse(path_node) }
        end
      end
      custom_geometry
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb