class Caracal::Renderers::RelationshipsRenderer
Public Instance Methods
to_xml()
click to toggle source
This method produces the xml required for the `word/settings.xml` sub-document.
# File lib/caracal/renderers/relationships_renderer.rb, line 17 def to_xml builder = ::Nokogiri::XML::Builder.with(declaration_xml) do |xml| xml.send 'Relationships', root_options do document.relationships.each do |rel| xml.send 'Relationship', rel_options(rel) end end end builder.to_xml(save_options) end
Private Instance Methods
rel_options(rel)
click to toggle source
# File lib/caracal/renderers/relationships_renderer.rb, line 34 def rel_options(rel) opts = { 'Target' => rel.formatted_target, 'Type' => rel.formatted_type, 'Id' => rel.formatted_id} opts['TargetMode'] = 'External' if rel.target_mode? opts end
root_options()
click to toggle source
# File lib/caracal/renderers/relationships_renderer.rb, line 40 def root_options { 'xmlns' => 'http://schemas.openxmlformats.org/package/2006/relationships' } end