Sha256: e4878582082dd9d02e9aeddfbfaad1e03ffe801df095a6d0a93ceb0d493891ba

Contents?: true

Size: 701 Bytes

Versions: 13

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing `settings.xml` file
  class DocumentSettings < OOXMLDocumentObject
    # @return [OoxmlSize] size of default tab
    attr_accessor :default_tab_stop

    # Parse Settings object
    # @return [DocumentSettings] result of parsing
    def parse
      settings_path = "#{root_object.unpacked_folder}word/settings.xml"
      return nil unless File.exist?(settings_path)

      doc = parse_xml(settings_path)
      doc.xpath('w:settings/*').each do |node_child|
        case node_child.name
        when 'defaultTabStop'
          @default_tab_stop = OoxmlSize.new.parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ooxml_parser-0.38.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.37.1 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.37.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.36.1 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.36.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.35.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.34.2 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.34.1 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.34.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.33.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.32.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.31.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb
ooxml_parser-0.30.0 lib/ooxml_parser/docx_parser/document_structure/document_settings.rb