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 211 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 248 def bottom bottom_box.bottom end
gutter()
click to toggle source
# File lib/prawn/grid.rb, line 232 def gutter @bs[0].gutter end
height()
click to toggle source
# File lib/prawn/grid.rb, line 228 def height top_box.top - bottom_box.bottom end
left()
click to toggle source
# File lib/prawn/grid.rb, line 236 def left left_box.left end
name()
click to toggle source
# File lib/prawn/grid.rb, line 216 def name @bs.map {|b| b.name}.join(":") end
right()
click to toggle source
# File lib/prawn/grid.rb, line 240 def right right_box.right end
top()
click to toggle source
# File lib/prawn/grid.rb, line 244 def top top_box.top end
total_height()
click to toggle source
# File lib/prawn/grid.rb, line 220 def total_height @bs[0].total_height end
width()
click to toggle source
# File lib/prawn/grid.rb, line 224 def width right_box.right - left_box.left end
Private Instance Methods
bottom_box()
click to toggle source
# File lib/prawn/grid.rb, line 265 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 253 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 257 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 261 def top_box @top_box ||= @bs.max {|a,b| a.top <=> b.top} end