Class: Prawn::Document::MultiBox
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
#bottom ⇒ Object
254
255
256
|
# File 'lib/prawn/grid.rb', line 254
def bottom
bottom_box.bottom
end
|
#gutter ⇒ Object
238
239
240
|
# File 'lib/prawn/grid.rb', line 238
def gutter
@boxes[0].gutter
end
|
#height ⇒ Object
234
235
236
|
# File 'lib/prawn/grid.rb', line 234
def height
top_box.top - bottom_box.bottom
end
|
#left ⇒ Object
242
243
244
|
# File 'lib/prawn/grid.rb', line 242
def left
left_box.left
end
|
#name ⇒ Object
222
223
224
|
# File 'lib/prawn/grid.rb', line 222
def name
@boxes.map(&:name).join(':')
end
|
#right ⇒ Object
246
247
248
|
# File 'lib/prawn/grid.rb', line 246
def right
right_box.right
end
|
#top ⇒ Object
250
251
252
|
# File 'lib/prawn/grid.rb', line 250
def top
top_box.top
end
|
#total_height ⇒ Object
226
227
228
|
# File 'lib/prawn/grid.rb', line 226
def total_height
@boxes[0].total_height
end
|
#width ⇒ Object
230
231
232
|
# File 'lib/prawn/grid.rb', line 230
def width
right_box.right - left_box.left
end
|