Sha256: 74e0c3e817836c9e9f7fc40311695b5f4a700c9a7d152d3ceb9831d1759556f0
Contents?: true
Size: 897 Bytes
Versions: 4
Compression:
Stored size: 897 Bytes
Contents
require_relative 'docx_shape_line_path/docx_shape_line_element' module OoxmlParser # Docx Shape Line Path class DocxShapeLinePath < OOXMLDocumentObject attr_accessor :width, :height, :fill, :stroke, :elements def initialize(elements = [], parent: nil) @elements = elements @parent = parent end # Parse DocxShapeLinePath object # @param node [Nokogiri::XML:Element] node to parse # @return [DocxShapeLinePath] result of parsing def parse(node) node.attributes.each do |key, value| case key when 'w' @width = value.value.to_f when 'h' @height = value.value.to_f when 'stroke' @stroke = value.value.to_f end end node.xpath('*').each do |node_child| @elements << DocxShapeLineElement.new(parent: self).parse(node_child) end self end end end
Version data entries
4 entries across 4 versions & 1 rubygems