Class: HexaPDF::Layout::TextLayouter::Box

Inherits:
Object
  • Object
show all
Defined in:
lib/hexapdf/layout/text_layouter.rb

Overview

Used for layouting. Describes an item with a fixed width, like an InlineBox or TextFragment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ Box

Creates a new Box for the item.



81
82
83
# File 'lib/hexapdf/layout/text_layouter.rb', line 81

def initialize(item)
  @item = item
end

Instance Attribute Details

#itemObject (readonly)

The wrapped item.



78
79
80
# File 'lib/hexapdf/layout/text_layouter.rb', line 78

def item
  @item
end

Instance Method Details

#heightObject

The height of the item.



91
92
93
# File 'lib/hexapdf/layout/text_layouter.rb', line 91

def height
  @item.height
end

#typeObject

Returns :box.



96
97
98
# File 'lib/hexapdf/layout/text_layouter.rb', line 96

def type
  :box
end

#widthObject

The width of the item.



86
87
88
# File 'lib/hexapdf/layout/text_layouter.rb', line 86

def width
  @item.width
end