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

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

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

Returns a new instance of OOXMLCustomGeometry.



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

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

Instance Attribute Details

#paths_listObject

Returns the value of attribute paths_list.



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

def paths_list
  @paths_list
end

Instance Method Details

#parse(node) ⇒ OOXMLCustomGeometry

Parse OOXMLCustomGeometry object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



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

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