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

- (MultiBox) initialize(pdf, b1, b2)

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

- (Object) bottom



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

def bottom
  bottom_box.bottom
end

- (Object) gutter



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

def gutter
  @bs[0].gutter
end

- (Object) height



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

def height
  top_box.top - bottom_box.bottom
end

- (Object) left



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

def left
  left_box.left
end

- (Object) name



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

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

- (Object) right



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

def right
  right_box.right
end

- (Object) top



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

def top
  top_box.top
end

- (Object) total_height



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

def total_height
  @bs[0].total_height
end

- (Object) width



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

def width
  right_box.right - left_box.left
end