Methods

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 136
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 140
def render(flags={})
  leftover = super(flags)
  leftover.collect { |hash| hash[:text] }.join
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.