Class: HexaPDF::Layout::TextBox::Box

Inherits:
Object
  • Object
show all
Defined in:
lib/hexapdf/layout/text_box.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.



75
76
77
# File 'lib/hexapdf/layout/text_box.rb', line 75

def initialize(item)
  @item = item
end

Instance Attribute Details

#itemObject (readonly)

The wrapped item.



72
73
74
# File 'lib/hexapdf/layout/text_box.rb', line 72

def item
  @item
end

Instance Method Details

#typeObject

Returns :box.



85
86
87
# File 'lib/hexapdf/layout/text_box.rb', line 85

def type
  :box
end

#widthObject

The width of the item.



80
81
82
# File 'lib/hexapdf/layout/text_box.rb', line 80

def width
  @item.width
end