Sha256: dbee2975d445ee6a5b726e9c3d0acf99b4f40d75986b4a93fdd8a848887da24e
Contents?: true
Size: 814 Bytes
Versions: 49
Compression:
Stored size: 814 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Docx Drawing Position class DocxDrawingPosition < OOXMLDocumentObject attr_accessor :relative_from, :offset, :align # Parse DocxDrawingPosition object # @param node [Nokogiri::XML:Element] node to parse # @return [DocxDrawingPosition] result of parsing def parse(node) node.attributes.each do |key, value| case key when 'relativeFrom' @relative_from = value_to_symbol(value) end end node.xpath('*').each do |node_child| case node_child.name when 'posOffset', 'pctPosHOffset', 'pctPosVOffset' @offset = OoxmlSize.new(node_child.text.to_f, :emu) when 'align' @align = node_child.text.to_sym end end self end end end
Version data entries
49 entries across 49 versions & 1 rubygems