Class: Arrolio::Flowables::FigureFlowable
- Inherits:
-
GroupFlowable
- Object
- Arrolio::Flowable
- GroupFlowable
- Arrolio::Flowables::FigureFlowable
- Defined in:
- lib/arrolio/flowables/figure_flowable.rb
Overview
A figure is atomic: the image and its caption never split across a page boundary (FOP keep-together on figure blocks — an orphaned caption at a page top is a rendering defect).
Instance Attribute Summary
Attributes inherited from GroupFlowable
Attributes inherited from Arrolio::Flowable
Instance Method Summary collapse
- #caption ⇒ Object
- #image ⇒ Object
-
#initialize(image, caption) ⇒ FigureFlowable
constructor
A new instance of FigureFlowable.
Methods inherited from GroupFlowable
#do_split, #emit, #height, #splittable?
Methods inherited from Arrolio::Flowable
#do_split, #emit, #height, #keep_together?, #keep_with_next?, #min_keep_height, #page_break_after?, #page_break_before?, #space_after, #space_before, #split, #splittable?
Constructor Details
#initialize(image, caption) ⇒ FigureFlowable
Returns a new instance of FigureFlowable.
9 10 11 |
# File 'lib/arrolio/flowables/figure_flowable.rb', line 9 def initialize(image, caption) super([image, caption]) end |
Instance Method Details
#caption ⇒ Object
14 |
# File 'lib/arrolio/flowables/figure_flowable.rb', line 14 def caption = @parts.last |
#image ⇒ Object
13 |
# File 'lib/arrolio/flowables/figure_flowable.rb', line 13 def image = @parts.first |