Method: Prawn::Table::Cell#initialize

Defined in:
lib/prawn/table/cell.rb

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

Sets up a cell on the document pdf, at the given x/y location point, with the given options. Cell, like Table, follows the “options set accessors” paradigm (see “Options” under the Table documentation), so any cell accessor cell.foo = :bar can be set by providing the option :foo => :bar here.



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/prawn/table/cell.rb', line 208

def initialize(pdf, point, options={})
  @pdf   = pdf
  @point = point

  # Set defaults; these can be changed by options
  @padding       = [5, 5, 5, 5]
  @borders       = [:top, :bottom, :left, :right]
  @border_widths = [1] * 4
  @border_colors = ['000000'] * 4
  @border_lines  = [:solid] * 4
  @colspan = 1
  @rowspan = 1
  @dummy_cells = []

  options.each { |k, v| send("#{k}=", v) }

  @initializer_run = true
end