class OoxmlParser::Bar
Class for `bar` data
Attributes
element[RW]
position[RW]
Public Class Methods
new(parent: nil)
click to toggle source
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb, line 8 def initialize(parent: nil) @position = :bottom super end
Public Instance Methods
parse(node)
click to toggle source
Parse Bar
object @param node [Nokogiri::XML:Element] node to parse @return [Bar] result of parsing
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb, line 16 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