Class: OoxmlParser::OOXMLCustomGeometry

Inherits:
Object
  • Object
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths_list = []) ⇒ OOXMLCustomGeometry

Returns a new instance of OOXMLCustomGeometry.



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 8

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

Instance Attribute Details

#paths_listObject

Returns the value of attribute paths_list.



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

def paths_list
  @paths_list
end

Class Method Details

.parse(custom_geometry_node) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb', line 12

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