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



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

#bottomObject



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

def bottom
  bottom_box.bottom
end

#gutterObject



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

def gutter
  @bs[0].gutter
end

#heightObject



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

def height
  top_box.top - bottom_box.bottom
end

#leftObject



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

def left
  left_box.left
end

#nameObject



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

def name
  @bs.map {|b| b.name}.join(":")
end

#rightObject



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

def right
  right_box.right
end

#topObject



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

def top
  top_box.top
end

#total_heightObject



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

def total_height
  @bs[0].total_height
end

#widthObject



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

def width
  right_box.right - left_box.left
end