class OoxmlParser::Limit

Class for `limUpp`, `limLow` data

Attributes

element[RW]
limit[RW]
type[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/limit.rb, line 8
def initialize(parent: nil)
  @type = :upper
  super
end

Public Instance Methods

parse(node) click to toggle source

Parse Limit object @param node [Nokogiri::XML:Element] node to parse @return [Limit] result of parsing

# File lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb, line 16
def parse(node)
  @type = :lower if node.name == 'limLow'
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'lim'
      @limit = DocxFormula.new(parent: self).parse(node_child)
    end
  end
  @element = DocxFormula.new(parent: self).parse(node)
  self
end