Class: Docxtor2::DocumentBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/docxtor2/document_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#documentObject



15
16
17
# File 'lib/docxtor2/document_builder.rb', line 15

def document
  @document
end