Class: OoxmlParser::NumberingProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::NumberingProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb
Overview
Class for parsing ‘numPr` tags
Instance Attribute Summary collapse
-
#font ⇒ Object
Returns the value of attribute font.
-
#i_level ⇒ ValuedChild
readonly
I level.
-
#image ⇒ Object
Returns the value of attribute image.
-
#num_id ⇒ ValuedChild
readonly
Numbering id.
-
#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 ⇒ AbstractNumbering
AbstractNumbering of current properties.
-
#ilvl ⇒ Integer
I-level value.
-
#initialize(ilvl = 0, parent: nil) ⇒ NumberingProperties
constructor
A new instance of NumberingProperties.
-
#numbering_level_current ⇒ AbstractNumbering
Level list of current numbering.
-
#numbering_properties ⇒ Integer
Numbering properties.
-
#parse(node) ⇒ NumberingProperties
Parse NumberingProperties.
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(ilvl = 0, parent: nil) ⇒ NumberingProperties
Returns a new instance of NumberingProperties.
12 13 14 15 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 12 def initialize(ilvl = 0, parent: nil) @default_i_level = ilvl super(parent: parent) end |
Instance Attribute Details
#font ⇒ Object
Returns the value of attribute font.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def font @font end |
#i_level ⇒ ValuedChild (readonly)
Returns i level.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 8 def i_level @i_level end |
#image ⇒ Object
Returns the value of attribute image.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def image @image end |
#num_id ⇒ ValuedChild (readonly)
Returns numbering id.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 10 def num_id @num_id end |
#size ⇒ Object
Returns the value of attribute size.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def size @size end |
#start_at ⇒ Object
Returns the value of attribute start_at.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def start_at @start_at end |
#symbol ⇒ Object
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 6 def type @type end |
Instance Method Details
#abstruct_numbering ⇒ AbstractNumbering
Returns AbstractNumbering of current properties.
18 19 20 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 18 def abstruct_numbering root_object.numbering.properties_by_num_id(numbering_properties) end |
#ilvl ⇒ Integer
Returns i-level value.
43 44 45 46 47 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 43 def ilvl return @default_i_level unless @i_level @i_level.value end |
#numbering_level_current ⇒ AbstractNumbering
Returns level list of current numbering.
50 51 52 53 54 55 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 50 def numbering_level_current abstruct_numbering.level_list.each do |current_ilvl| return current_ilvl if current_ilvl.ilvl == ilvl end nil end |
#numbering_properties ⇒ Integer
Returns numbering properties.
38 39 40 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 38 def numbering_properties @num_id.value end |
#parse(node) ⇒ NumberingProperties
Parse NumberingProperties
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/numbering_properties.rb', line 25 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'ilvl' @i_level = ValuedChild.new(:integer, parent: self).parse(node_child) when 'numId' @num_id = ValuedChild.new(:integer, parent: self).parse(node_child) end end self end |