def render_section(section, object, &block)
begin
if section.is_a?(Class) && section <= Generators::Base
opts = options.dup
opts.update(:ignore_serializer => true)
sobj = section.new(opts)
sobj.generate(object, &block)
elsif section.is_a?(Generators::Base)
section.generate(object, &block)
elsif section.is_a?(Symbol) || section.is_a?(String)
return "" if run_before_sections(section, object).is_a?(FalseClass)
if section.is_a?(Symbol)
if respond_to?(section)
if method(section).arity != 1
send(section, &block)
else
send(section, object, &block)
end || ""
else
render(object, section, &block)
end
else
render(object, section, &block)
end
else
type = section.is_a?(String) || section.is_a?(Symbol) ? 'section' : 'generator'
log.warn "Ignoring invalid #{type} '#{section}' in #{self.class}"
""
end
end
end