class Prawn::Document::MultiBox

A MultiBox is specified by 2 Boxes and spans the areas between.

@group Experimental API

Public Class Methods

new(pdf, b1, b2) click to toggle source
# File lib/prawn/grid.rb, line 210
def initialize(pdf, b1, b2)
  @pdf = pdf
  @bs = [b1, b2]
end

Public Instance Methods

bottom() click to toggle source
# File lib/prawn/grid.rb, line 247
def bottom
  bottom_box.bottom
end
gutter() click to toggle source
# File lib/prawn/grid.rb, line 231
def gutter
  @bs[0].gutter
end
height() click to toggle source
# File lib/prawn/grid.rb, line 227
def height
  top_box.top - bottom_box.bottom
end
left() click to toggle source
# File lib/prawn/grid.rb, line 235
def left
  left_box.left
end
name() click to toggle source
# File lib/prawn/grid.rb, line 215
def name
  @bs.map {|b| b.name}.join(":")
end
right() click to toggle source
# File lib/prawn/grid.rb, line 239
def right
  right_box.right
end
top() click to toggle source
# File lib/prawn/grid.rb, line 243
def top
  top_box.top
end
total_height() click to toggle source
# File lib/prawn/grid.rb, line 219
def total_height
  @bs[0].total_height
end
width() click to toggle source
# File lib/prawn/grid.rb, line 223
def width
  right_box.right - left_box.left
end

Private Instance Methods

bottom_box() click to toggle source
# File lib/prawn/grid.rb, line 264
def bottom_box
  @bottom_box ||= @bs.min {|a,b| a.bottom <=> b.bottom}
end
left_box() click to toggle source
# File lib/prawn/grid.rb, line 252
def left_box
  @left_box ||= @bs.min {|a,b| a.left <=> b.left}
end
right_box() click to toggle source
# File lib/prawn/grid.rb, line 256
def right_box
  @right_box ||= @bs.max {|a,b| a.right <=> b.right}
end
top_box() click to toggle source
# File lib/prawn/grid.rb, line 260
def top_box
  @top_box ||= @bs.max {|a,b| a.top <=> b.top}
end