Class: Prawn::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/table/cell.rb

Experimental API collapse

Instance Method Details

#cell(options = {}) ⇒ Object

Instantiates and draws a cell on the document.

cell(:content => "Hello world!", :at => [12, 34])

See Prawn::Table::Cell.make for full options.


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

def cell(options={})
  cell = Table::Cell.make(self, options.delete(:content), options)
  cell.draw
  cell
end

#make_cell(content, options = {}) ⇒ Object

Set up, but do not draw, a cell. Useful for creating cells with formatting options to be inserted into a Table. Call draw on the resulting Cell to ink it.

See the documentation on Prawn::Cell for details on the arguments.


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

def make_cell(content, options={})
  Prawn::Table::Cell.make(self, content, options)
end