class OoxmlParser::DocxShapeLineElement
Docx Shape
Line Element
Attributes
points[RW]
type[RW]
Public Class Methods
new(points = [], parent: nil)
click to toggle source
Calls superclass method
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb, line 8 def initialize(points = [], parent: nil) @points = points super(parent: parent) end
Public Instance Methods
parse(node)
click to toggle source
Parse DocxShapeLineElement
@param [Nokogiri::XML:Node] node with DocxShapeLineElement
@return [DocxShapeLineElement] result of parsing
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb, line 16 def parse(node) case node.name when 'moveTo' @type = :move when 'lnTo' @type = :line when 'arcTo' @type = :arc when 'cubicBezTo' @type = :cubic_bezier when 'close' @type = :close end node.xpath('*').each do |node_child| case node_child.name when 'pt' @points << OOXMLCoordinates.parse(node_child) end end self end