Class: Caracal::Core::Models::PageBreakModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/caracal/core/models/page_break_model.rb

Overview

This class encapsulates the logic needed to store and manipulate page break data.

The :wrap option is not described in the project’s README because it exists purely as an internal Caracal concern. Page breaks at the document level must be wrapped in a paragraph node; page breaks within paragraph-like container simply add a run. There’s no need to trouble end users with this issue.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#valid?

Constructor Details

#initialize(options = {}, &block) ⇒ PageBreakModel

initialization



30
31
32
33
34
# File 'lib/caracal/core/models/page_break_model.rb', line 30

def initialize(options={}, &block)
  @page_break_wrap = DEFAULT_PAGE_BREAK_WRAP

  super options, &block
end

Instance Attribute Details

#page_break_wrapObject (readonly)

accessors



27
28
29
# File 'lib/caracal/core/models/page_break_model.rb', line 27

def page_break_wrap
  @page_break_wrap
end

Instance Method Details

#wrap(value) ⇒ Object

SETTERS ==============================


43
44
45
# File 'lib/caracal/core/models/page_break_model.rb', line 43

def wrap(value)
  @page_break_wrap = !!value
end