Module: Low::Templates::Renderer::ClassMethods
- Defined in:
- lib/templates/renderer.rb
Instance Method Summary collapse
- #build_template(template:, params:, engine:, namespace:) ⇒ Object
-
#render(event: nil) ⇒ Object
TODO: Handle situation where node is tested in a unit test and args come in here; expose them to the template.
- #template ⇒ Object
Instance Method Details
#build_template(template:, params:, engine:, namespace:) ⇒ Object
38 39 40 |
# File 'lib/templates/renderer.rb', line 38 def build_template(template:, params:, engine:, namespace:) @template = Template.new(template:, params:, engine:, namespace:) end |
#render(event: nil) ⇒ Object
TODO: Handle situation where node is tested in a unit test and args come in here; expose them to the template.
43 44 45 46 47 48 49 |
# File 'lib/templates/renderer.rb', line 43 def render(event: nil) node = self.new(event:) # GOAL: Make return value configurable; ResponseEvent, Response, or body. response = Low::Factories::ResponseFactory.html(body: response_body(node:, event:)) Low::Events::ResponseEvent.new(response:).tap { it.branch } end |
#template ⇒ Object
34 35 36 |
# File 'lib/templates/renderer.rb', line 34 def template @template end |