abstract class Crinja::Loader
- Crinja::Loader
- Reference
- Object
Overview
Base class for all loaders.
Direct Known Subclasses
- Crinja::Loader::BakedFileLoader(T)
- Crinja::Loader::ChoiceLoader
- Crinja::Loader::FileSystemLoader
- Crinja::Loader::HashLoader
- Crinja::Loader::PrefixLoader
Defined in:
loader.crInstance Method Summary
-
#get_source(env : Crinja, template : String) : ::Tuple(String, String?)
Get the template source, filename and reload helper for a template.
-
#list_templates : Iterable(String)
Iterates over all templates.
- #load(env, name)
Instance Method Detail
Get the template source, filename and reload helper for a template.
It's passed the environment and template name and has to return a
tuple in the form {source : String, filename : String?}
or raise a
TemplateNotFoundError
if it can't locate the template.
The source part of the returned tuple must be the source of the
template as string. The filename should be the name of the file on
the filesystem if it was loaded from there, otherwise nil
.
The filename is used for the tracebacks if no loader extension is used.