Class: OoxmlParser::NumberingProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::NumberingProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb
Overview
Class for parsing ‘numPr` tags
Instance Attribute Summary collapse
-
#font ⇒ Object
Returns the value of attribute font.
-
#ilvl ⇒ Object
Returns the value of attribute ilvl.
-
#numbering_properties ⇒ Object
Returns the value of attribute numbering_properties.
-
#size ⇒ Object
Returns the value of attribute size.
-
#start_at ⇒ Object
Returns the value of attribute start_at.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
- #abstruct_numbering ⇒ Object
-
#initialize(ilvl = 0, parent: nil) ⇒ NumberingProperties
constructor
A new instance of NumberingProperties.
- #numbering_level_current ⇒ Object
-
#parse(node) ⇒ NumberingProperties
Parse NumberingProperties.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(ilvl = 0, parent: nil) ⇒ NumberingProperties
Returns a new instance of NumberingProperties.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 6 def initialize(ilvl = 0, parent: nil) @ilvl = ilvl @parent = parent end |
Instance Attribute Details
#font ⇒ Object
Returns the value of attribute font.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def font @font end |
#ilvl ⇒ Object
Returns the value of attribute ilvl.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def ilvl @ilvl end |
#numbering_properties ⇒ Object
Returns the value of attribute numbering_properties.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def numbering_properties @numbering_properties end |
#size ⇒ Object
Returns the value of attribute size.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def size @size end |
#start_at ⇒ Object
Returns the value of attribute start_at.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def start_at @start_at end |
#symbol ⇒ Object
Returns the value of attribute symbol.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 4 def type @type end |
Instance Method Details
#abstruct_numbering ⇒ Object
11 12 13 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 11 def abstruct_numbering root_object.numbering.properties_by_num_id(@numbering_properties) end |
#numbering_level_current ⇒ Object
30 31 32 33 34 35 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 30 def numbering_level_current abstruct_numbering.level_list.each do |current_ilvl| return current_ilvl if current_ilvl.ilvl == @ilvl end nil end |
#parse(node) ⇒ NumberingProperties
Parse NumberingProperties
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb', line 18 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'ilvl' @ilvl = node_child.attribute('val').value.to_i when 'numId' @numbering_properties = node_child.attribute('val').value.to_i end end self end |