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_lines, #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_line, #border_bottom_line=, #border_bottom_width, #border_bottom_width=, #border_color=, #border_left_color, #border_left_color=, #border_left_line, #border_left_line=, #border_left_width, #border_left_width=, #border_line=, #border_right_color, #border_right_color=, #border_right_line, #border_right_line=, #border_right_width, #border_right_width=, #border_top_color, #border_top_color=, #border_top_line, #border_top_line=, #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=, #relative_x, #relative_y, #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.



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

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.



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

def subtable
  @subtable
end

Instance Method Details

#draw_contentObject

Draws the subtable.



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

def draw_content
  @subtable.draw
end

#max_widthObject

Proxied to subtable.



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

def max_width
  @subtable.cells.max_width
end

#min_widthObject

Proxied to subtable.



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

def min_width
  @subtable.cells.min_width
end

#natural_content_heightObject

Proxied to subtable.



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

def natural_content_height
  @subtable.cells.height
end

#natural_content_widthObject

Proxied to subtable.



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

def natural_content_width
  @subtable.cells.width
end

#text_color=(color) ⇒ Object

Sets the text color of the entire subtable.



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

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