class Prawn::Document::MultiBox
A MultiBox
is specified by 2 Boxes and spans the areas between.
@group Experimental API
Attributes
Public Class Methods
Source
# File lib/prawn/grid.rb, line 218 def initialize(pdf, box1, box2) @pdf = pdf @boxes = [box1, box2] end
Public Instance Methods
Source
# File lib/prawn/grid.rb, line 277 def bounding_box(&blk) pdf.bounding_box(top_left, width: width, height: height, &blk) end
Source
# File lib/prawn/grid.rb, line 281 def show(grid_color = 'CCCCCC') bounding_box do original_stroke_color = pdf.stroke_color pdf.stroke_color = grid_color pdf.text name pdf.stroke_bounds pdf.stroke_color = original_stroke_color end end
Source
# File lib/prawn/grid.rb, line 229 def total_height @boxes[0].total_height end
Private Instance Methods
Source
# File lib/prawn/grid.rb, line 307 def bottom_box @bottom_box ||= @boxes.min_by(&:bottom) end
Source
# File lib/prawn/grid.rb, line 295 def left_box @left_box ||= @boxes.min_by(&:left) end
Source
# File lib/prawn/grid.rb, line 299 def right_box @right_box ||= @boxes.max_by(&:right) end
Source
# File lib/prawn/grid.rb, line 303 def top_box @top_box ||= @boxes.max_by(&:top) end