Class: Expressr::Renderer
- Inherits:
-
Object
- Object
- Expressr::Renderer
- Defined in:
- lib/expressr/renderer.rb
Class Attribute Summary collapse
-
.engine ⇒ Object
Returns the value of attribute engine.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.engine ⇒ Object
Returns the value of attribute engine.
4 5 6 |
# File 'lib/expressr/renderer.rb', line 4 def engine @engine end |
Class Method Details
.engines ⇒ Object
21 22 23 24 25 26 |
# File 'lib/expressr/renderer.rb', line 21 def engines { 'haml' => 'Expressr::Renderers::Haml', 'slim' => 'Expressr::Renderers::Slim' } end |
Instance Method Details
#render(path, locals = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/expressr/renderer.rb', line 29 def render(path, locals={}) path = App.settings['root'].join(App.settings['views'], path) locals = App.settings['locals'].merge(locals) renderer.render(path, locals) end |
#renderer ⇒ Object
35 36 37 |
# File 'lib/expressr/renderer.rb', line 35 def renderer self.class.renderer end |