Class: Arrolio::TextLayout::KnuthPlass::Box
- Defined in:
- lib/arrolio/text_layout/knuth_plass/item.rb
Overview
A box is a unit of content that cannot be broken across lines (a word, a glyph cluster). Has a fixed width.
Instance Attribute Summary collapse
-
#char_length ⇒ Object
readonly
Returns the value of attribute char_length.
-
#char_offset ⇒ Object
readonly
Returns the value of attribute char_offset.
-
#run_index ⇒ Object
readonly
Returns the value of attribute run_index.
Attributes inherited from Item
Instance Method Summary collapse
- #box? ⇒ Boolean
-
#initialize(width:, run_index:, char_offset:, char_length:) ⇒ Box
constructor
A new instance of Box.
Methods inherited from Item
Constructor Details
#initialize(width:, run_index:, char_offset:, char_length:) ⇒ Box
Returns a new instance of Box.
26 27 28 29 30 31 |
# File 'lib/arrolio/text_layout/knuth_plass/item.rb', line 26 def initialize(width:, run_index:, char_offset:, char_length:) super(width: width) @run_index = run_index @char_offset = char_offset @char_length = char_length end |
Instance Attribute Details
#char_length ⇒ Object (readonly)
Returns the value of attribute char_length.
24 25 26 |
# File 'lib/arrolio/text_layout/knuth_plass/item.rb', line 24 def char_length @char_length end |
#char_offset ⇒ Object (readonly)
Returns the value of attribute char_offset.
24 25 26 |
# File 'lib/arrolio/text_layout/knuth_plass/item.rb', line 24 def char_offset @char_offset end |
#run_index ⇒ Object (readonly)
Returns the value of attribute run_index.
24 25 26 |
# File 'lib/arrolio/text_layout/knuth_plass/item.rb', line 24 def run_index @run_index end |
Instance Method Details
#box? ⇒ Boolean
33 |
# File 'lib/arrolio/text_layout/knuth_plass/item.rb', line 33 def box? = true |