Class: Prawn::DocumentBuilder::Layout
- Inherits:
-
Object
- Object
- Prawn::DocumentBuilder::Layout
- Defined in:
- lib/prawn/document_builder/layout.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(builder, document) ⇒ Layout
constructor
A new instance of Layout.
- #overflow(command) ⇒ Object
- #remaining_space ⇒ Object
Constructor Details
#initialize(builder, document) ⇒ Layout
Returns a new instance of Layout.
4 5 6 7 |
# File 'lib/prawn/document_builder/layout.rb', line 4 def initialize(builder, document) @builder = builder @document = document end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
9 10 11 |
# File 'lib/prawn/document_builder/layout.rb', line 9 def builder @builder end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
9 10 11 |
# File 'lib/prawn/document_builder/layout.rb', line 9 def document @document end |
Instance Method Details
#overflow(command) ⇒ Object
19 20 21 22 |
# File 'lib/prawn/document_builder/layout.rb', line 19 def overflow(command) document.start_new_page builder.commands.unshift(command) end |
#remaining_space ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/prawn/document_builder/layout.rb', line 11 def remaining_space Prawn::Document::BoundingBox.new( document.bounds, [0,document.cursor], :width => document.bounds.width, :height => document.cursor ) end |