Class: Sidewalk::TemplateHandlers::ErbHandler

Inherits:
Base
  • Object
show all
Defined in:
lib/sidewalk/template_handlers/erb_handler.rb

Overview

Handler for ERB Templates.

Defined Under Namespace

Classes: Delegate

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ErbHandler

Returns a new instance of ErbHandler.



10
11
12
13
14
# File 'lib/sidewalk/template_handlers/erb_handler.rb', line 10

def initialize path
  super path
  @template = ERB::new(File.read(path))
  @template.filename = path
end

Instance Method Details

#render(controller) ⇒ Object



16
17
18
# File 'lib/sidewalk/template_handlers/erb_handler.rb', line 16

def render controller
  Delegate.new(@template, controller).render
end