Class: OoxmlParser::Bar
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Bar
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb
Overview
Class for ‘bar` data
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
-
#position_object ⇒ ValuedChild
readonly
Position object.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ Bar
constructor
A new instance of Bar.
-
#parse(node) ⇒ Bar
Parse Bar object.
-
#position ⇒ Symbol
Position of bar.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ Bar
Returns a new instance of Bar.
10 11 12 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb', line 10 def initialize(parent: nil) super end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
8 9 10 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb', line 8 def element @element end |
#position_object ⇒ ValuedChild (readonly)
Returns position object.
7 8 9 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb', line 7 def position_object @position_object end |
Instance Method Details
#parse(node) ⇒ Bar
Parse Bar object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb', line 17 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_object = ValuedChild.new(:symbol, parent: self).parse(node_child_child) end end end end @element = DocxFormula.new(parent: self).parse(node) self end |
#position ⇒ Symbol
Returns position of bar.
34 35 36 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/bar.rb', line 34 def position @position_object.value end |