Class: Waves::Renderers::Haml::Scope

Inherits:
Object
  • Object
show all
Includes:
Helpers::DocType, Helpers::Layouts, Helpers::Model, Helpers::View
Defined in:
lib/waves/layers/renderers/haml.rb

Overview

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

Constant Summary

Constants included from Helpers::DocType

Helpers::DocType::DOCTYPES

Instance Method Summary collapse

Methods included from Helpers::DocType

#doctype

Instance Method Details

#<<(s) ⇒ Object



50
51
52
# File 'lib/waves/layers/renderers/haml.rb', line 50

def <<(s)
  eval("@haml_buffer", @binding).push_text s # add to rendered output
end

#capture(&block) ⇒ Object



54
55
56
# File 'lib/waves/layers/renderers/haml.rb', line 54

def capture(&block)
  capture_haml(nil, &block)
end