Class: Prawn::Document::MultiBox
- Inherits:
-
Box
- Object
- Box
- Prawn::Document::MultiBox
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
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
#bottom ⇒ Object
228
229
230
|
# File 'lib/prawn/layout/grid.rb', line 228
def bottom
bottom_box.bottom
end
|
#gutter ⇒ Object
212
213
214
|
# File 'lib/prawn/layout/grid.rb', line 212
def gutter
@bs[0].gutter
end
|
#height ⇒ Object
208
209
210
|
# File 'lib/prawn/layout/grid.rb', line 208
def height
top_box.top - bottom_box.bottom
end
|
#left ⇒ Object
216
217
218
|
# File 'lib/prawn/layout/grid.rb', line 216
def left
left_box.left
end
|
#name ⇒ Object
196
197
198
|
# File 'lib/prawn/layout/grid.rb', line 196
def name
@bs.map {|b| b.name}.join(":")
end
|
#right ⇒ Object
220
221
222
|
# File 'lib/prawn/layout/grid.rb', line 220
def right
right_box.right
end
|
#top ⇒ Object
224
225
226
|
# File 'lib/prawn/layout/grid.rb', line 224
def top
top_box.top
end
|
#total_height ⇒ Object
200
201
202
|
# File 'lib/prawn/layout/grid.rb', line 200
def total_height
@bs[0].total_height
end
|
#width ⇒ Object
204
205
206
|
# File 'lib/prawn/layout/grid.rb', line 204
def width
right_box.right - left_box.left
end
|