Module: Waves::Renderers::Haml

Extended by:
Mixin
Defined in:
lib/layers/renderers/haml.rb

Defined Under Namespace

Classes: Scope

Constant Summary collapse

Extension =
:haml

Class Method Summary collapse

Methods included from Mixin

filename, helper, included, template

Class Method Details

.render(path, assigns) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/layers/renderers/haml.rb', line 13

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