Module: OoxmlParser::DocumentStructureHelpers

Included in:
DocumentStructure
Defined in:
lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb

Overview

method to help to work with DocumentStructure

Instance Method Summary collapse

Instance Method Details

#with_data?True, false

Returns if structure contain any user data.

Returns:

  • (True, false)

    if structure contain any user data



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb', line 5

def with_data?
  return true if @elements.length > 1
  @elements.each do |current_element|
    return true if current_element.with_data?
  end
  @notes.each do |current_note|
    current_note.elements.each do |note_element|
      return true if note_element.with_data?
    end
  end
  false
end