class PureDocx::XmlGenerators::Base

Attributes

content[R]
rels_constructor[R]

Public Class Methods

new(content, rels_constructor) click to toggle source
# File lib/puredocx/xml_generators/base.rb, line 6
def initialize(content, rels_constructor)
  @content          = content
  @rels_constructor = rels_constructor
end

Public Instance Methods

params() click to toggle source
# File lib/puredocx/xml_generators/base.rb, line 19
def params
  {}
end
template() click to toggle source
# File lib/puredocx/xml_generators/base.rb, line 15
def template
  raise NotImplementedError, "#{__method__} is not implemented."
end
xml() click to toggle source
# File lib/puredocx/xml_generators/base.rb, line 11
def xml
  params.each_with_object(template.clone) { |(param, value), memo| memo.gsub!(param, value.to_s) }
end