Method: DataTable.render

Defined in:
lib/data-table.rb

.render(collection) {|t| ... } ⇒ Object

Yields:

  • (t)


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/data-table.rb', line 8

def self.render(collection, &_blk)
  # make a new table
  t = DataTable::Table.new(collection)

  # yield it to the block for configuration
  yield t

  # modify the data structure if necessary and do calculations
  t.prepare_data

  # render the table
  t.render
end