### Home Classes Methods

### In Files

- lib/prawn/text/box.rb

### Parent

Prawn::Text::Formatted::Box

### Methods

- ::new
- #render

### Files

- COPYING
- GPLv2
- GPLv3
- LICENSE

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Core
- Prawn::Core::Page
- Prawn::Core::Page::GraphicsState
- Prawn::Core::Reference
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::Internals
- Prawn::Document::PageGeometry
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::GraphicState
- Prawn::GraphicStateStack
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::Gradient
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::Images
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Layout
- Prawn::Measurements
- Prawn::Outline
- Prawn::Stamp
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Arcfour
- Numeric

No matching classes.

# Prawn::Text::Box

Generally, one would use the Prawn::Text#text_box convenience method. However, using Text::Box.new in conjunction with render(:dry_run=> true) enables one to do look-ahead calculations prior to placing text on the page, or to determine how much vertical space was consumed by the printed text

### Public Class Methods

new(string, options={}) click to toggle source

    # File lib/prawn/text/box.rb, line 118
    def initialize(string, options={})
      super([{ :text => string }], options)
    end

### Public Instance Methods

render(flags={}) click to toggle source

    # File lib/prawn/text/box.rb, line 122
    def render(flags={})
      leftover = super(flags)
      leftover.collect { |hash| hash[:text] }.join
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.