Sha256: 558cf37c122c810c3ecc9282f792261e430b066a13b72d23f78f12beb1dcd968

Contents?: true

Size: 791 Bytes

Versions: 32

Compression:

Stored size: 791 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
      super
    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

32 entries across 32 versions & 1 rubygems

Version Path
ooxml_parser-0.33.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.32.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.31.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.30.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.29.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.28.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.27.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.26.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.25.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.24.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.23.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.22.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.21.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.20.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.19.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.18.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.18.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.17.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.16.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb
ooxml_parser-0.15.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb