Method: YARD::Templates::Engine.render
- Defined in:
- lib/yard/templates/engine.rb
.render(options = {}) ⇒ String
Renders a template on a code object using a set of default (overridable) options. Either the :object
or :type
keys must be provided.
If a :serializer
key is provided and :serialize
is not set to false, the rendered contents will be serialized through the Serializers::Base object. See with_serializer.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/yard/templates/engine.rb', line 81 def render( = {}) = () mod = template(.template, .type, .format) if .serializer && .serialize != false with_serializer(.object, .serializer) { mod.run() } else mod.run() end end |