Class: Docxtor2::DocumentBuilder
- Inherits:
-
Object
- Object
- Docxtor2::DocumentBuilder
- Defined in:
- lib/docxtor2/document_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #document ⇒ Object
-
#initialize(block) ⇒ DocumentBuilder
constructor
A new instance of DocumentBuilder.
Constructor Details
#initialize(block) ⇒ DocumentBuilder
Returns a new instance of DocumentBuilder.
10 11 12 13 |
# File 'lib/docxtor2/document_builder.rb', line 10 def initialize(block) content = ContentBuilder.build(&block) @document = Package::Document.new(content) end |
Class Method Details
.build(&block) ⇒ Object
4 5 6 7 |
# File 'lib/docxtor2/document_builder.rb', line 4 def build(&block) instance = new(block) instance.document end |
Instance Method Details
#document ⇒ Object
15 16 17 |
# File 'lib/docxtor2/document_builder.rb', line 15 def document @document end |