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.



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

def initialize(item)
  @item = item
end

Instance Attribute Details

#itemObject (readonly)

The wrapped item.



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

def item
  @item
end

Instance Method Details

#heightObject

The height of the item.



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

def height
  @item.height
end

#inspectObject

:nodoc:



104
105
106
# File 'lib/hexapdf/layout/text_layouter.rb', line 104

def inspect #:nodoc:
  "Box[#{@item.inspect}]"
end

#typeObject

Returns :box.



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

def type
  :box
end

#widthObject

The width of the item.



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

def width
  @item.width
end