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_colors, #border_widths, #borders, #colspan, #content, #dummy_cells, #height, #padding, #rowspan

Instance Method Summary collapse

Methods inherited from Prawn::Table::Cell

#avg_spanned_min_width, #border_bottom_color, #border_bottom_color=, #border_bottom_width, #border_bottom_width=, #border_color=, #border_left_color, #border_left_color=, #border_left_width, #border_left_width=, #border_right_color, #border_right_color=, #border_right_width, #border_right_width=, #border_top_color, #border_top_color=, #border_top_width, #border_top_width=, #border_width=, #content_height, #content_width, #draw, #draw_background, #draw_borders, #draw_bounded_content, draw_cells, #height_ignoring_span, make, #max_width_ignoring_span, #min_width_ignoring_span, #padding_bottom, #padding_bottom=, #padding_left, #padding_left=, #padding_right, #padding_right=, #padding_top, #padding_top=, #set_width_constraints, #spanned_content_height, #spanned_content_width, #style, #width, #width=, #width_ignoring_span, #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