@ -17,10 +17,12 @@ class Report::Walker
end
def for_empty_cell(&block)
puts __method__ unless block_given?
access_block(:empty_cell, &block) || access_block(:cell)
def access_block(name, &block)
puts method.center(80, '= '), caller[0..1] unless block_given?
@blocks ||= {}
@blocks[name] = block if block
@blocks[name]
@ -14,12 +14,8 @@ class Widget::Table < Widget::Base
def render_with_options(options = {}, &block)
self.debug = options[:debug] || false
if canvas = options[:to]
canvas << "\n" << render(&block)
else
render(&block)
canvas = options[:to] ? options[:to] << "\n" : ""
canvas << render(&block)
def table_widget