Sha256: 361019a50dd98500412b408281408d2d04a2cdd992b7e0569a8091751c710b0a
Contents?: true
Size: 888 Bytes
Versions: 32
Compression:
Stored size: 888 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Docx Shape Line Element class DocxShapeLineElement < OOXMLDocumentObject attr_accessor :type, :points def initialize(points = [], parent: nil) @points = points super(parent: parent) end # Parse DocxShapeLineElement # @param [Nokogiri::XML:Node] node with DocxShapeLineElement # @return [DocxShapeLineElement] result of parsing 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 end end
Version data entries
32 entries across 32 versions & 1 rubygems