Class: Caracal::Renderers::SettingsRenderer

Inherits:
XmlRenderer
  • Object
show all
Defined in:
lib/caracal/renderers/settings_renderer.rb

Instance Attribute Summary

Attributes inherited from XmlRenderer

#document

Instance Method Summary collapse

Methods inherited from XmlRenderer

#initialize, render

Constructor Details

This class inherits a constructor from Caracal::Renderers::XmlRenderer

Instance Method Details

#to_xmlObject

This method produces the xml required for the ‘word/settings.xml` sub-document.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/caracal/renderers/settings_renderer.rb', line 17

def to_xml
  builder = ::Nokogiri::XML::Builder.with(declaration_xml) do |xml|
    xml.send 'w:settings', root_options do
      xml.send 'w:displayBackgroundShape', { 'w:val' => '1' }
      xml.send 'w:defaultTabStop', { 'w:val' => '720' }
      xml.send 'w:compat' do
        xml.send 'w:compatSetting', { 'w:val' => '14', 'w:name' => 'compatibilityMode', 'w:uri' => 'http://schemas.microsoft.com/office/word' }
      end
    end
  end
  builder.to_xml(save_options)
end