Class: PureDocx::XmlGenerators::Base
- Inherits:
-
Object
- Object
- PureDocx::XmlGenerators::Base
- Defined in:
- lib/puredocx/xml_generators/base.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#rels_constructor ⇒ Object
readonly
Returns the value of attribute rels_constructor.
Instance Method Summary collapse
-
#initialize(content, rels_constructor) ⇒ Base
constructor
A new instance of Base.
- #params ⇒ Object
- #template ⇒ Object
- #xml ⇒ Object
Constructor Details
#initialize(content, rels_constructor) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/puredocx/xml_generators/base.rb', line 6 def initialize(content, rels_constructor) @content = content @rels_constructor = rels_constructor end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
4 5 6 |
# File 'lib/puredocx/xml_generators/base.rb', line 4 def content @content end |
#rels_constructor ⇒ Object (readonly)
Returns the value of attribute rels_constructor.
4 5 6 |
# File 'lib/puredocx/xml_generators/base.rb', line 4 def rels_constructor @rels_constructor end |
Instance Method Details
#params ⇒ Object
19 20 21 |
# File 'lib/puredocx/xml_generators/base.rb', line 19 def params {} end |
#template ⇒ Object
15 16 17 |
# File 'lib/puredocx/xml_generators/base.rb', line 15 def template raise NotImplementedError, "#{__method__} is not implemented." end |
#xml ⇒ Object
11 12 13 |
# 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 |