Class: OoxmlParser::GroupChar
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::GroupChar
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb
Overview
Class for ‘groupChr` data
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
-
#position_object ⇒ ValuedChild
readonly
Position object.
-
#symbol_object ⇒ ValuedChild
readonly
Symbol object.
-
#vertical_align_object ⇒ ValuedChild
readonly
Vertical align object.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ GroupChar
Parse GroupChar object.
-
#position ⇒ String
Position value.
-
#symbol ⇒ String
Symbol value.
-
#vertical_align ⇒ String
Vertical align value.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
12 13 14 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 12 def element @element end |
#position_object ⇒ ValuedChild (readonly)
Returns position object.
9 10 11 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 9 def position_object @position_object end |
#symbol_object ⇒ ValuedChild (readonly)
Returns symbol object.
7 8 9 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 7 def symbol_object @symbol_object end |
#vertical_align_object ⇒ ValuedChild (readonly)
Returns vertical align object.
11 12 13 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 11 def vertical_align_object @vertical_align_object end |
Instance Method Details
#parse(node) ⇒ GroupChar
Parse GroupChar object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 17 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'groupChrPr' node_child.xpath('*').each do |node_child_child| case node_child_child.name when 'chr' @symbol_object = ValuedChild.new(:string, parent: self).parse(node_child_child) when 'pos' @position_object = ValuedChild.new(:string, parent: self).parse(node_child_child) when 'vertJc' @vertical_align_object = ValuedChild.new(:string, parent: self).parse(node_child_child) end end end end @element = DocxFormula.new(parent: self).parse(node) self end |
#position ⇒ String
Returns position value.
43 44 45 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 43 def position @position_object.value end |
#symbol ⇒ String
Returns symbol value.
38 39 40 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 38 def symbol @symbol_object.value end |
#vertical_align ⇒ String
Returns vertical align value.
48 49 50 |
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/group_char.rb', line 48 def vertical_align @vertical_align_object.value end |