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, b1, b2) ⇒ MultiBox
Returns a new instance of MultiBox.
216
217
218
219
|
# File 'lib/prawn/grid.rb', line 216
def initialize(pdf, b1, b2)
@pdf = pdf
@bs = [b1, b2]
end
|
Instance Method Details
#bottom ⇒ Object
253
254
255
|
# File 'lib/prawn/grid.rb', line 253
def bottom
bottom_box.bottom
end
|
#gutter ⇒ Object
237
238
239
|
# File 'lib/prawn/grid.rb', line 237
def gutter
@bs[0].gutter
end
|
#height ⇒ Object
233
234
235
|
# File 'lib/prawn/grid.rb', line 233
def height
top_box.top - bottom_box.bottom
end
|
#left ⇒ Object
241
242
243
|
# File 'lib/prawn/grid.rb', line 241
def left
left_box.left
end
|
#name ⇒ Object
221
222
223
|
# File 'lib/prawn/grid.rb', line 221
def name
@bs.map(&:name).join(':')
end
|
#right ⇒ Object
245
246
247
|
# File 'lib/prawn/grid.rb', line 245
def right
right_box.right
end
|
#top ⇒ Object
249
250
251
|
# File 'lib/prawn/grid.rb', line 249
def top
top_box.top
end
|
#total_height ⇒ Object
225
226
227
|
# File 'lib/prawn/grid.rb', line 225
def total_height
@bs[0].total_height
end
|
#width ⇒ Object
229
230
231
|
# File 'lib/prawn/grid.rb', line 229
def width
right_box.right - left_box.left
end
|