Class: Sidewalk::TemplateHandlers::ErbHandler::Delegate
- Inherits:
-
BaseDelegate
- Object
- BaseDelegate
- Sidewalk::TemplateHandlers::ErbHandler::Delegate
- Includes:
- ERB::Util
- Defined in:
- lib/sidewalk/template_handlers/erb_handler.rb
Overview
Class representing the controller to ERB.
Using a delegate so we can add extra methods to the binding without polluting the class - for example, most people expect an ERB template to have access to ERB::Util#h
Instance Method Summary collapse
-
#initialize(template, controller) ⇒ Delegate
constructor
A new instance of Delegate.
- #render ⇒ Object
Constructor Details
#initialize(template, controller) ⇒ Delegate
Returns a new instance of Delegate.
29 30 31 32 |
# File 'lib/sidewalk/template_handlers/erb_handler.rb', line 29 def initialize template, controller @template = template super controller end |
Instance Method Details
#render ⇒ Object
34 35 36 |
# File 'lib/sidewalk/template_handlers/erb_handler.rb', line 34 def render @template.result binding end |