Class: Tilt::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/markup_helpers/tilt.rb

Instance Method Summary collapse

Instance Method Details

#render(scope = Object.new, locals = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/markup_helpers/tilt.rb', line 3

def render scope = Object.new, locals = {}, &block
  scope.instance_variable_set :@__tilt_context, self
  output = evaluate scope, locals || {}, &block
  if scope.instance_variable_get :@__tilt_context
    scope.send :remove_instance_variable, :@__tilt_context
  end
  output
end