Class: Arrolio::Flowables::FigureFlowable

Inherits:
GroupFlowable show all
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

#parts

Attributes inherited from Arrolio::Flowable

#style

Instance Method Summary collapse

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

#captionObject



14
# File 'lib/arrolio/flowables/figure_flowable.rb', line 14

def caption = @parts.last

#imageObject



13
# File 'lib/arrolio/flowables/figure_flowable.rb', line 13

def image = @parts.first