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.



84
85
86
# File 'lib/hexapdf/layout/text_layouter.rb', line 84

def initialize(item)
  @item = item
end

Instance Attribute Details

#itemObject (readonly)

The wrapped item.



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

def item
  @item
end

Instance Method Details

#heightObject

The height of the item.



94
95
96
# File 'lib/hexapdf/layout/text_layouter.rb', line 94

def height
  @item.height
end

#typeObject

Returns :box.



99
100
101
# File 'lib/hexapdf/layout/text_layouter.rb', line 99

def type
  :box
end

#widthObject

The width of the item.



89
90
91
# File 'lib/hexapdf/layout/text_layouter.rb', line 89

def width
  @item.width
end