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

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

Constant Summary

Constants included from RootNamespaces

RootNamespaces::POSSIBLE_NAMESPACES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RootNamespaces

included

Constructor Details

#initializeSettings

Returns a new instance of Settings.


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

def initialize
  @settings = []
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings


9
10
11
# File 'lib/openxml/docx/parts/settings.rb', line 9

def settings
  @settings
end

Instance Method Details

#<<(child) ⇒ Object


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

def <<(child)
  settings << child
end

#to_xmlObject


19
20
21
22
23
24
25
26
# File 'lib/openxml/docx/parts/settings.rb', line 19

def to_xml
  build_standalone_xml do |xml|
    xml.settings(root_namespaces) {
      xml.parent.namespace = :w
      settings.each { |setting| setting.to_xml(xml) }
    }
  end
end