Class: Docxtor2::ContentBuilder
- Inherits:
-
ElementList
- Object
- ElementList
- Docxtor2::ContentBuilder
- Includes:
- BlockEvaluator
- Defined in:
- lib/docxtor2/content_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(block) ⇒ ContentBuilder
constructor
A new instance of ContentBuilder.
Methods included from BlockEvaluator
Methods inherited from ElementList
Constructor Details
#initialize(block) ⇒ ContentBuilder
Returns a new instance of ContentBuilder.
18 19 20 21 |
# File 'lib/docxtor2/content_builder.rb', line 18 def initialize(block) super() evaluate &block end |
Class Method Details
.build(&block) ⇒ Object
6 7 8 9 |
# File 'lib/docxtor2/content_builder.rb', line 6 def build(&block) instance = new(block) instance.build end |
Instance Method Details
#build ⇒ Object
23 24 25 26 27 |
# File 'lib/docxtor2/content_builder.rb', line 23 def build xml = Builder::XmlMarkup.new write_elements(xml) xml.target! end |