Class: Luoma::TemplateLoader
- Inherits:
-
Object
- Object
- Luoma::TemplateLoader
- Defined in:
- lib/luoma/loader.rb,
sig/luoma/loader.rbs
Overview
The base class for all template loaders.
Direct Known Subclasses
Instance Method Summary collapse
-
#get_source(env, name, context: nil, **kwargs) ⇒ TemplateSource
Load and return template source text and any associated data.
-
#load(env, name, globals: nil, context: nil, **kwargs) ⇒ Template
(Environment, String, ?globals: t_namespace?, ?context: RenderContext?, **kwargs) -> Template.
Instance Method Details
#get_source(env, name, context: nil, **kwargs) ⇒ TemplateSource
Load and return template source text and any associated data. (Environment, String, ?context: RenderContext?, **untyped) -> TemplateSource
8 9 10 |
# File 'lib/luoma/loader.rb', line 8 def get_source(env, name, context: nil, **kwargs) raise "not implemented" end |
#load(env, name, globals: nil, context: nil, **kwargs) ⇒ Template
(Environment, String, ?globals: t_namespace?, ?context: RenderContext?, **kwargs) -> Template
13 14 15 16 17 18 19 20 |
# File 'lib/luoma/loader.rb', line 13 def load(env, name, globals: nil, context: nil, **kwargs) data = get_source(env, name, context: context, **kwargs) env.parse(data.source, name: data.name, globals: globals, up_to_date: data.up_to_date, overlay: data.matter) end |