fix and simplyfy Widget::Table#render_with_options

pull/6827/head
Konstantin Haase 14 years ago
parent 7702d6e229
commit 6b7a6d9f10
  1. 2
      lib/report/walker.rb
  2. 8
      lib/widget/table.rb

@ -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)
end
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
end
def render_with_options(options = {}, &block)
self.debug = options[:debug] || false
if canvas = options[:to]
canvas << "\n" << render(&block)
else
render(&block)
end
canvas = options[:to] ? options[:to] << "\n" : ""
canvas << render(&block)
end
def table_widget

Loading…
Cancel
Save