class Phlex::SGML
def render(renderable = nil, &)
def render(renderable = nil, &) case renderable when Phlex::SGML renderable.call(@_buffer, context: @_context, view_context: @_view_context, parent: self, &) when Class if renderable < Phlex::SGML renderable.new.call(@_buffer, context: @_context, view_context: @_view_context, parent: self, &) end when Enumerable renderable.each { |r| render(r, &) } when Proc, Method if renderable.arity == 0 yield_content_with_no_args(&renderable) else yield_content(&renderable) end when String plain(renderable) when nil yield_content(&) if block_given? else raise Phlex::ArgumentError.new("You can't render a #{renderable.inspect}.") end nil end