Class: MVCLI::Renderer
- Inherits:
-
Object
- Object
- MVCLI::Renderer
- Defined in:
- lib/mvcli/renderer.rb
Instance Method Summary collapse
-
#initialize(root) ⇒ Renderer
constructor
A new instance of Renderer.
- #render(output, path, context) ⇒ Object
Constructor Details
Instance Method Details
#render(output, path, context) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/mvcli/renderer.rb', line 9 def render(output, path, context) filename = @root.join('app/views', path + '.txt.erb').to_s compiler = MVCLI::ERB.new template = compiler.compile File.read(filename), filename template.call(context, output) end |