Sha256: 5b19d7b94a04cb59e6d74154b375eadddb8e5bd4abd3b2bb5e78eaa97c934c3f
Contents?: true
Size: 883 Bytes
Versions: 5
Compression:
Stored size: 883 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 @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
5 entries across 5 versions & 1 rubygems