Sha256: f671c4e9b9f08a481339bd9734519d5e5ea482dd1a8b5ebc85b88c0733ef9c6c
Contents?: true
Size: 906 Bytes
Versions: 9
Compression:
Stored size: 906 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.new(parent: self).parse(node_child) end end self end end end
Version data entries
9 entries across 9 versions & 1 rubygems