Class: OoxmlParser::Suffix

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb

Overview

Class for storing Suffix ‘w:suff` This element specifies the content which shall be added between a given numbering level’s text and the text of every numbered paragraph which references that numbering level. If this element is omitted, then its value shall be assumed to be tab. >ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference 17.9.29.

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(value = :tab, parent: nil) ⇒ Suffix

Returns a new instance of Suffix.



14
15
16
17
18
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb', line 14

def initialize(value = :tab,
               parent: nil)
  @value = value
  super(parent: parent)
end

Instance Attribute Details

#valueString

Returns value of suffix.

Returns:

  • (String)

    value of suffix



12
13
14
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb', line 12

def value
  @value
end

Instance Method Details

#parse(node) ⇒ Suffix

Parse Suffix

Parameters:

  • node (Nokogiri::XML:Node)

    with Suffix

Returns:

  • (Suffix)

    result of parsing



23
24
25
26
27
28
29
30
31
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb', line 23

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'val'
      @value = value.value.to_sym
    end
  end
  self
end