Class: OoxmlParser::OOXMLCustomGeometry

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb

Overview

Docx Custom Geometry

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(paths_list = [], parent: nil) ⇒ OOXMLCustomGeometry

Returns a new instance of OOXMLCustomGeometry.



9
10
11
12
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb', line 9

def initialize(paths_list = [], parent: nil)
  @paths_list = paths_list
  super(parent: parent)
end

Instance Attribute Details

#paths_listObject

Returns the value of attribute paths_list.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb', line 7

def paths_list
  @paths_list
end

Instance Method Details

#parse(node) ⇒ OOXMLCustomGeometry

Parse OOXMLCustomGeometry object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb', line 17

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'pathLst'
      node_child.xpath('a:path', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').each do |path_node|
        @paths_list << DocxShapeLinePath.new(parent: self).parse(path_node)
      end
    end
  end
  self
end