Class: HexaPDF::Layout::TextBox::Glue
- Inherits:
-
Object
- Object
- HexaPDF::Layout::TextBox::Glue
- Defined in:
- lib/hexapdf/layout/text_box.rb
Overview
Used for layouting. Describes a glue item, i.e. an item describing white space that could potentially be shrunk or stretched.
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
The wrapped item.
-
#shrinkability ⇒ Object
readonly
The amount by which the glue could be shrunk.
-
#stretchability ⇒ Object
readonly
The amount by which the glue could be stretched.
Instance Method Summary collapse
-
#initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) ⇒ Glue
constructor
Creates a new Glue for the item.
-
#type ⇒ Object
Returns :glue.
Constructor Details
#initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) ⇒ Glue
Creates a new Glue for the item.
105 106 107 108 109 |
# File 'lib/hexapdf/layout/text_box.rb', line 105 def initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) @item = item @stretchability = stretchability @shrinkability = shrinkability end |
Instance Attribute Details
#item ⇒ Object (readonly)
The wrapped item.
96 97 98 |
# File 'lib/hexapdf/layout/text_box.rb', line 96 def item @item end |
#shrinkability ⇒ Object (readonly)
The amount by which the glue could be shrunk.
102 103 104 |
# File 'lib/hexapdf/layout/text_box.rb', line 102 def shrinkability @shrinkability end |
#stretchability ⇒ Object (readonly)
The amount by which the glue could be stretched.
99 100 101 |
# File 'lib/hexapdf/layout/text_box.rb', line 99 def stretchability @stretchability end |
Instance Method Details
#type ⇒ Object
Returns :glue.
112 113 114 |
# File 'lib/hexapdf/layout/text_box.rb', line 112 def type :glue end |