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.
211
212
213
214
|
# File 'lib/prawn/grid.rb', line 211
def initialize(pdf, b1, b2)
@pdf = pdf
@bs = [b1, b2]
end
|
Instance Method Details
#bottom ⇒ Object
248
249
250
|
# File 'lib/prawn/grid.rb', line 248
def bottom
bottom_box.bottom
end
|
#gutter ⇒ Object
232
233
234
|
# File 'lib/prawn/grid.rb', line 232
def gutter
@bs[0].gutter
end
|
#height ⇒ Object
228
229
230
|
# File 'lib/prawn/grid.rb', line 228
def height
top_box.top - bottom_box.bottom
end
|
#left ⇒ Object
236
237
238
|
# File 'lib/prawn/grid.rb', line 236
def left
left_box.left
end
|
#name ⇒ Object
216
217
218
|
# File 'lib/prawn/grid.rb', line 216
def name
@bs.map {|b| b.name}.join(":")
end
|
#right ⇒ Object
240
241
242
|
# File 'lib/prawn/grid.rb', line 240
def right
right_box.right
end
|
#top ⇒ Object
244
245
246
|
# File 'lib/prawn/grid.rb', line 244
def top
top_box.top
end
|
#total_height ⇒ Object
220
221
222
|
# File 'lib/prawn/grid.rb', line 220
def total_height
@bs[0].total_height
end
|
#width ⇒ Object
224
225
226
|
# File 'lib/prawn/grid.rb', line 224
def width
right_box.right - left_box.left
end
|