Class: OpenXml::Docx::Parts::Settings

Inherits:
Part
  • Object
show all
Defined in:
lib/openxml/docx/parts/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



7
8
9
# File 'lib/openxml/docx/parts/settings.rb', line 7

def initialize
  @settings = []
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



5
6
7
# File 'lib/openxml/docx/parts/settings.rb', line 5

def settings
  @settings
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
# File 'lib/openxml/docx/parts/settings.rb', line 11

def to_xml
  build_standalone_xml do |xml|
    xml.settings("xmlns:w" => "http://schemas.openxmlformats.org/wordprocessingml/2006/main") {
      xml.parent.namespace = xml.parent.namespace_definitions.find { |ns| ns.prefix == "w" }
    }
  end
end