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.



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

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

Instance Method Details

#bottomObject



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

def bottom
  bottom_box.bottom
end

#gutterObject



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

def gutter
  @bs[0].gutter
end

#heightObject



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

def height
  top_box.top - bottom_box.bottom
end

#leftObject



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

def left
  left_box.left
end

#nameObject



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

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

#rightObject



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

def right
  right_box.right
end

#topObject



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

def top
  top_box.top
end

#total_heightObject



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

def total_height
  @bs[0].total_height
end

#widthObject



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

def width
  right_box.right - left_box.left
end