Class: Arrolio::Flowables::PageSequenceStart

Inherits:
Arrolio::Flowable show all
Defined in:
lib/arrolio/flowables/page_sequence_start.rb

Overview

Forces a page break AND switches the active page sequence: role + header/footer templates apply to subsequent pages until the next PageSequenceStart.

Instance Attribute Summary collapse

Attributes inherited from Arrolio::Flowable

#style

Instance Method Summary collapse

Methods inherited from Arrolio::Flowable

#do_split, #keep_together?, #keep_with_next?, #page_break_after?, #page_break_before?, #space_after, #space_before, #split, #splittable?

Constructor Details

#initialize(role:, header_template: nil, footer_template: nil, header_align: :right, footer_align: :center, initial_page_number: nil) ⇒ PageSequenceStart

Returns a new instance of PageSequenceStart.



12
13
14
15
16
17
18
19
20
21
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 12

def initialize(role:, header_template: nil, footer_template: nil,
               header_align: :right, footer_align: :center,
               initial_page_number: nil)
  @role = role.to_sym
  @header_template = header_template
  @footer_template = footer_template
  @header_align = header_align.to_sym
  @footer_align = footer_align.to_sym
  @initial_page_number = initial_page_number
end

Instance Attribute Details

Returns the value of attribute footer_align.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def footer_align
  @footer_align
end

Returns the value of attribute footer_template.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def footer_template
  @footer_template
end

#header_alignObject (readonly)

Returns the value of attribute header_align.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def header_align
  @header_align
end

#header_templateObject (readonly)

Returns the value of attribute header_template.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def header_template
  @header_template
end

#initial_page_numberObject (readonly)

Returns the value of attribute initial_page_number.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def initial_page_number
  @initial_page_number
end

#roleObject (readonly)

Returns the value of attribute role.



9
10
11
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 9

def role
  @role
end

Instance Method Details

#emit(_x, _y, _width, _context = nil) ⇒ Object



25
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 25

def emit(_x, _y, _width, _context = nil) = [[], 0.0]

#height(_width, _context = nil) ⇒ Object



23
# File 'lib/arrolio/flowables/page_sequence_start.rb', line 23

def height(_width, _context = nil) = 0.0