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

Returns a new instance of MultiBox.



188
189
190
191
# File 'lib/prawn/layout/grid.rb', line 188

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

Instance Method Details

#bottomObject



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

def bottom
  bottom_box.bottom
end

#gutterObject



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

def gutter
  @bs[0].gutter
end

#heightObject



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

def height
  top_box.top - bottom_box.bottom
end

#leftObject



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

def left
  left_box.left
end

#nameObject



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

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

#rightObject



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

def right
  right_box.right
end

#topObject



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

def top
  top_box.top
end

#total_heightObject



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

def total_height
  @bs[0].total_height
end

#widthObject



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

def width
  right_box.right - left_box.left
end