Class: Prawn::DocumentBuilder
- Inherits:
-
Object
- Object
- Prawn::DocumentBuilder
- Defined in:
- lib/prawn/document_builder.rb,
lib/prawn/document_builder/layout.rb,
lib/prawn/document_builder/command.rb,
lib/prawn/document_builder/constructs/path_construct.rb,
lib/prawn/document_builder/modifications/path_modification.rb,
lib/prawn/document_builder/constructs/flowing_text_construct.rb,
lib/prawn/document_builder/modifications/layout_modification.rb
Defined Under Namespace
Classes: Command, FlowingTextConstruct, Layout, LayoutModification, PathConstruct, PathModification
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize ⇒ DocumentBuilder
constructor
A new instance of DocumentBuilder.
Constructor Details
#initialize ⇒ DocumentBuilder
Returns a new instance of DocumentBuilder.
8 9 10 |
# File 'lib/prawn/document_builder.rb', line 8 def initialize @commands = [] end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
12 13 14 |
# File 'lib/prawn/document_builder.rb', line 12 def commands @commands end |
Instance Method Details
#compile ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/prawn/document_builder.rb', line 14 def compile document = ::Prawn::Document.new layout = ::Prawn::DocumentBuilder::Layout.new(self, document) original_commands = commands.dup while c = commands.shift c.execute(document, layout) end self.commands = original_commands document end |