Class: Prawn::Table::Cell::Subtable

Inherits:
Prawn::Table::Cell show all
Defined in:
lib/prawn/table/cell/subtable.rb

Overview

A Cell that contains another table.

Constant Summary

Constants inherited from Prawn::Table::Cell

FPTolerance

Instance Attribute Summary collapse

Attributes inherited from Prawn::Table::Cell

#background_color, #border_color, #border_width, #borders, #content, #height, #padding

Instance Method Summary collapse

Methods inherited from Prawn::Table::Cell

#content_height, #content_width, #draw, make, #width, #width=, #x, #x=, #y, #y=

Constructor Details

#initialize(pdf, point, options = {}) ⇒ Subtable

Returns a new instance of Subtable.



18
19
20
21
22
23
24
# File 'lib/prawn/table/cell/subtable.rb', line 18

def initialize(pdf, point, options={})
  super
  @subtable = options[:content]

  # Subtable padding defaults to zero
  @padding = [0, 0, 0, 0]
end

Instance Attribute Details

#subtableObject (readonly)

Returns the value of attribute subtable.



16
17
18
# File 'lib/prawn/table/cell/subtable.rb', line 16

def subtable
  @subtable
end

Instance Method Details

#draw_contentObject

Draws the subtable.



58
59
60
# File 'lib/prawn/table/cell/subtable.rb', line 58

def draw_content
  @subtable.draw
end

#max_widthObject

Proxied to subtable.



46
47
48
# File 'lib/prawn/table/cell/subtable.rb', line 46

def max_width
  @subtable.cells.max_width
end

#min_widthObject

Proxied to subtable.



40
41
42
# File 'lib/prawn/table/cell/subtable.rb', line 40

def min_width
  @subtable.cells.min_width
end

#natural_content_heightObject

Proxied to subtable.



52
53
54
# File 'lib/prawn/table/cell/subtable.rb', line 52

def natural_content_height
  @subtable.cells.height
end

#natural_content_widthObject

Proxied to subtable.



34
35
36
# File 'lib/prawn/table/cell/subtable.rb', line 34

def natural_content_width
  @subtable.cells.width
end

#text_color=(color) ⇒ Object

Sets the text color of the entire subtable.



28
29
30
# File 'lib/prawn/table/cell/subtable.rb', line 28

def text_color=(color)
  @subtable.cells.text_color = color
end