Sha256: 7541259fb3cb15e2047edd2ebd30bdeb5ce512a195170cde6871a23d73860702
Contents?: true
Size: 802 Bytes
Versions: 8
Compression:
Stored size: 802 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Class for `bar` data class Bar < OOXMLDocumentObject attr_accessor :position, :element def initialize(parent: nil) @position = :bottom @parent = parent end # Parse Bar object # @param node [Nokogiri::XML:Element] node to parse # @return [Bar] result of parsing def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'barPr' node_child.xpath('*').each do |node_child_child| case node_child_child.name when 'pos' @position = node_child_child.attribute('val').value.to_sym end end end end @element = DocxFormula.new(parent: self).parse(node) self end end end
Version data entries
8 entries across 8 versions & 1 rubygems