new

new(source, identifier, handler, details) Class Public methods

encode!

encode!() Instance Public methods This method is responsible for properly setting the encoding of the source. Until this point, we assume that the source is BINARY data. If no additional information is supplied, we assume the encoding is the same as Encoding.default_external. The user can also specify the encoding via a comment on the first line of the template (# encoding: NAME-OF-ENCODING). This will work with any template engine, as we process out the encoding comment before pas

inspect

inspect() Instance Public methods

refresh

refresh(view) Instance Public methods Receives a view object and return a template similar to self by using @virtual_path. This method is useful if you have a template object but it does not contain its source anymore since it was already compiled. In such cases, all you need to do is to call refresh passing in the view object. Notice this method raises an error if the template to be refreshed does not have a virtual path set (true just for inline templates).

render

render(view, locals, buffer=nil, &block) Instance Public methods Render a template. If the template was not compiled yet, it is done exactly before rendering. This method is instrumented as â!render_template.action_viewâ. Notice that we use a bang in this instrumentation because you don't want to consume this in production. This is only slow if it's being listened to.

supports_streaming?

supports_streaming?() Instance Public methods Returns if the underlying handler supports streaming. If so, a streaming buffer may be passed when it start rendering.

type

type() Instance Public methods

instrument

instrument(action, &block) Instance Protected methods

determine_default_helper_class

determine_default_helper_class(name) Instance Public methods

helper_class

helper_class() Instance Public methods