Module: Grass::Render::Renderer
Instance Method Summary
collapse
#include_partial, #render_content, #render_partial
Instance Method Details
#initialize(source, data = {}) ⇒ Object
16
17
18
19
|
# File 'lib/grass/render/renderer.rb', line 16
def initialize source, data = {}
@source = source
@data = data
end
|
#render ⇒ Object
21
22
23
24
25
26
27
|
# File 'lib/grass/render/renderer.rb', line 21
def render
result = @source.raw
templates.each do |template|
result = template.new{result}.render(self,@data)
end
result
end
|
#templates ⇒ Object
29
30
31
|
# File 'lib/grass/render/renderer.rb', line 29
def templates
@templates ||= Tilt.templates_for(@source.handler || @source.format)
end
|