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
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
#bottom ⇒ Object
229
230
231
|
# File 'lib/prawn/layout/grid.rb', line 229
def bottom
bottom_box.bottom
end
|
#gutter ⇒ Object
213
214
215
|
# File 'lib/prawn/layout/grid.rb', line 213
def gutter
@bs[0].gutter
end
|
#height ⇒ Object
209
210
211
|
# File 'lib/prawn/layout/grid.rb', line 209
def height
top_box.top - bottom_box.bottom
end
|
#left ⇒ Object
217
218
219
|
# File 'lib/prawn/layout/grid.rb', line 217
def left
left_box.left
end
|
#name ⇒ Object
197
198
199
|
# File 'lib/prawn/layout/grid.rb', line 197
def name
@bs.map {|b| b.name}.join(":")
end
|
#right ⇒ Object
221
222
223
|
# File 'lib/prawn/layout/grid.rb', line 221
def right
right_box.right
end
|
#top ⇒ Object
225
226
227
|
# File 'lib/prawn/layout/grid.rb', line 225
def top
top_box.top
end
|
#total_height ⇒ Object
201
202
203
|
# File 'lib/prawn/layout/grid.rb', line 201
def total_height
@bs[0].total_height
end
|
#width ⇒ Object
205
206
207
|
# File 'lib/prawn/layout/grid.rb', line 205
def width
right_box.right - left_box.left
end
|