Class: Waves::Renderers::Haml

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/renderers/haml.rb

Class Method Summary collapse

Methods included from Mixin

included

Class Method Details

.render(path, assigns) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/renderers/haml.rb', line 30

def self.render( path, assigns )
  engine = ::Haml::Engine.new( template( path ) )
  scope = Scope.new
  helper = helper( path )
  scope.meta_eval { include( helper ) }
  scope.instance_eval do
    assigns.each { |key,val| instance_variable_set("@#{key}",val) unless key == :request }
  end
  engine.render(scope, assigns)
end