Module: Waves::Renderers::Erubis::ViewMethods
- Defined in:
- lib/waves/layers/renderers/erubis.rb
Overview
def self.render( path, assigns={} )
eruby = ::Erubis::Eruby.new( template( path ) )
helper = helper( path )
context = ::Erubis::Context.new( assigns )
( class << context ; self ; end ).module_eval do
include( helper )
def << (s) ; s ; end
end
eruby.evaluate( context )
end
Instance Method Summary collapse
Instance Method Details
#erb(string, assigns = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/waves/layers/renderers/erubis.rb', line 35 def erb(string, assigns={}) eruby = ::Erubis::Eruby.new( string ) helper = Waves.main::Helpers[self.class.basename] context = ::Erubis::Context.new( assigns ) ( class << context ; self ; end ).module_eval do include( helper ) def << (s) ; s ; end end eruby.evaluate( context ) end |