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, 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

#bottomObject



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

def bottom
  bottom_box.bottom
end

#gutterObject



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

def gutter
  @bs[0].gutter
end

#heightObject



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

def height
  top_box.top - bottom_box.bottom
end

#leftObject



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

def left
  left_box.left
end

#nameObject



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

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

#rightObject



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

def right
  right_box.right
end

#topObject



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

def top
  top_box.top
end

#total_heightObject



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

def total_height
  @bs[0].total_height
end

#widthObject



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

def width
  right_box.right - left_box.left
end