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