def widget(target, assigns = {}, options = {}, &block)
      if target.is_a? Class
        target.new(assigns, &block)._emit_via(self, options)
      else
        unless assigns.empty?
          raise "Unexpected second parameter. Did you mean to pass in assigns when you instantiated the #{target.class.to_s}?"
        end
        target._emit_via(self, options, &block)
      end
    end
def widget(target, assigns = {}, options = {}, &block)
      if target.is_a? Class
        target.new(assigns, &block)._emit_via(self, options)
      else
        unless assigns.empty?
          raise "Unexpected second parameter. Did you mean to pass in assigns when you instantiated the #{target.class.to_s}?"
        end
        target._emit_via(self, options, &block)
      end
    end
Emits a (nested) widget onto the current widget's output stream. Accepts
 either a class or an instance. If the first argument is a class, then
 the second argument is a hash used to populate its instance variables.
 If the first argument is an instance then the hash must be unspecified
 (or empty). If a block is passed to this method, then it gets set as the
 emited widget's block, and will be executed when that widget calls
 +call_block+ or calls +super+ from inside its +content+ method.

 This is the preferred way to call one widget from inside another. This
 method assures that the same output string is used, which gives better
 performance than using +capture+ or +to_html+.