Class: Arrolio::Content::PageBreak

Inherits:
Object
  • Object
show all
Defined in:
lib/arrolio/content/page_break.rb

Overview

An explicit page break in the content tree. Emitted by the adapter when it encounters a element or a clause with a page-break-before hint. The FlowBuilder converts this to a Flowables::PageBreak.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil) ⇒ PageBreak

Returns a new instance of PageBreak.



12
13
14
15
# File 'lib/arrolio/content/page_break.rb', line 12

def initialize(id: nil)
  @id = id&.to_s
  freeze
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/arrolio/content/page_break.rb', line 10

def id
  @id
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



17
18
19
# File 'lib/arrolio/content/page_break.rb', line 17

def ==(other)
  other.is_a?(self.class) && id == other.id
end

#hashObject



23
24
25
# File 'lib/arrolio/content/page_break.rb', line 23

def hash
  [self.class, id].hash
end