Class: Prawn::Document::MultiBox

Inherits:
Box
  • Object
show all
Defined in:
lib/prawn/layout/grid.rb

Overview

A MultiBox is specified by 2 Boxes and spans the areas between.

Instance Attribute Summary

Attributes inherited from Box

#pdf

Instance Method Summary collapse

Methods inherited from Box

#bottom_left, #bottom_right, #bounding_box, #show, #top_left, #top_right

Constructor Details

#initialize(pdf, b1, b2) ⇒ MultiBox

:nodoc:



191
192
193
194
# File 'lib/prawn/layout/grid.rb', line 191

def initialize(pdf, b1, b2)
  @pdf = pdf
  @bs = [b1, b2]
end

Instance Method Details

#bottomObject



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

def bottom
  bottom_box.bottom
end

#gutterObject



212
213
214
# File 'lib/prawn/layout/grid.rb', line 212

def gutter
  @bs[0].gutter
end

#heightObject



208
209
210
# File 'lib/prawn/layout/grid.rb', line 208

def height
  top_box.top - bottom_box.bottom
end

#leftObject



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

def left
  left_box.left
end

#nameObject



196
197
198
# File 'lib/prawn/layout/grid.rb', line 196

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

#rightObject



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

def right
  right_box.right
end

#topObject



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

def top
  top_box.top
end

#total_heightObject



200
201
202
# File 'lib/prawn/layout/grid.rb', line 200

def total_height
  @bs[0].total_height
end

#widthObject



204
205
206
# File 'lib/prawn/layout/grid.rb', line 204

def width
  right_box.right - left_box.left
end