Class: Prawn::Document::MultiBox

Inherits:
GridBox
  • Object
show all
Defined in:
lib/prawn/grid.rb

Overview

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

Instance Attribute Summary

Attributes inherited from GridBox

#pdf

Experimental API collapse

Methods inherited from GridBox

#bottom_left, #bottom_right, #bounding_box, #show, #top_left, #top_right

Constructor Details

#initialize(pdf, box1, box2) ⇒ MultiBox

Returns a new instance of MultiBox.



217
218
219
220
# File 'lib/prawn/grid.rb', line 217

def initialize(pdf, box1, box2)
  @pdf = pdf
  @boxes = [box1, box2]
end

Instance Method Details

#bottomObject



254
255
256
# File 'lib/prawn/grid.rb', line 254

def bottom
  bottom_box.bottom
end

#gutterObject



238
239
240
# File 'lib/prawn/grid.rb', line 238

def gutter
  @boxes[0].gutter
end

#heightObject



234
235
236
# File 'lib/prawn/grid.rb', line 234

def height
  top_box.top - bottom_box.bottom
end

#leftObject



242
243
244
# File 'lib/prawn/grid.rb', line 242

def left
  left_box.left
end

#nameObject



222
223
224
# File 'lib/prawn/grid.rb', line 222

def name
  @boxes.map(&:name).join(':')
end

#rightObject



246
247
248
# File 'lib/prawn/grid.rb', line 246

def right
  right_box.right
end

#topObject



250
251
252
# File 'lib/prawn/grid.rb', line 250

def top
  top_box.top
end

#total_heightObject



226
227
228
# File 'lib/prawn/grid.rb', line 226

def total_height
  @boxes[0].total_height
end

#widthObject



230
231
232
# File 'lib/prawn/grid.rb', line 230

def width
  right_box.right - left_box.left
end