lib/erector/abstract_widget.rb
def widget(target, assigns = {}, options = {}, &block)
      if target.is_a? Class
        target.new(assigns, &block)._render_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._render_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
# rendered widget's block.
#
# 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+.
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
rendered widget's block.

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+.
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 rendered widget ' s block . 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 + .
def widget(target, assigns = {}, options = {}, &block)
      if target.is_a? Class
        target.new(assigns, &block)._render_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._render_via(self, options, &block)
      end
    end
def widget ( target , assigns = { } , options = { } , & block ) if target . is_a? Class target . new ( assigns , & block ) . _render_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 . _render_via ( self , options , & block ) end end
Emits a (nested) widget onto the current widget's output stream.
Emits a ( nested ) widget onto the current widget ' s output stream .
target
assigns
options
block