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 215
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 252
def bottom
  bottom_box.bottom
end
gutter() click to toggle source
# File lib/prawn/grid.rb, line 236
def gutter
  @bs[0].gutter
end
height() click to toggle source
# File lib/prawn/grid.rb, line 232
def height
  top_box.top - bottom_box.bottom
end
left() click to toggle source
# File lib/prawn/grid.rb, line 240
def left
  left_box.left
end
name() click to toggle source
# File lib/prawn/grid.rb, line 220
def name
  @bs.map(&:name).join(":")
end
right() click to toggle source
# File lib/prawn/grid.rb, line 244
def right
  right_box.right
end
top() click to toggle source
# File lib/prawn/grid.rb, line 248
def top
  top_box.top
end
total_height() click to toggle source
# File lib/prawn/grid.rb, line 224
def total_height
  @bs[0].total_height
end
width() click to toggle source
# File lib/prawn/grid.rb, line 228
def width
  right_box.right - left_box.left
end

Private Instance Methods

bottom_box() click to toggle source
# File lib/prawn/grid.rb, line 270
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 258
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 262
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 266
def top_box
  @top_box ||= @bs.max { |a, b| a.top <=> b.top }
end