Method: DataDoc::Present#each_cell
- Defined in:
- lib/data_doc/present.rb
#each_cell(col, &blk) ⇒ Object
Define a block which is called to override the contents of a cell.
Return nil to revert to the default behaviour.
present 'select one, two from relation' do
each_cell 'one' do |col, row|
row[col] == 'true' ? 'Short' : 'Long'
end
end
75 76 77 |
# File 'lib/data_doc/present.rb', line 75 def each_cell(col, &blk) # :yields: col, row @each_cell[col] = blk end |