class Phlex::HTML
def render(renderable, *args, **kwargs, &block)
def render(renderable, *args, **kwargs, &block) if renderable.is_a?(Phlex::HTML) renderable.call(@_target, view_context: @_view_context, parent: self, &block) elsif renderable.is_a?(Class) && renderable < Phlex::HTML raise ArgumentError, "You tried to render the Phlex view class: #{renderable.name} but you probably meant to render an instance of that class instead." else raise ArgumentError, "You can't render a #{renderable}." end nil end