Class: Sidewalk::TemplateHandlers::Base

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

Overview

Base class for TemplateHandlers.

This currently just defines an interface - see ErbHandler for an example.

Instances of this class may be re-used between requests. Anything request-specific needs to go in the #render method.

Direct Known Subclasses

ErbHandler, HamlHandler, RxhpHandler

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Base

A new instance of the controller.

Parameters:

  • path (String)

    a full path to a template source file.



26
27
# File 'lib/sidewalk/template_handlers/base.rb', line 26

def initialize path
end

Instance Method Details

#render(controller) ⇒ String

Actually render a template.

Parameters:

Returns:

  • (String)

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/sidewalk/template_handlers/base.rb', line 19

def render controller
  raise NotImplementedError.new
end