Tilt::HamlTemplate

Haml template implementation. See: haml.hamptoncatlin.com/

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
     # File lib/sinatra/tilt.rb, line 447
447:     def evaluate(scope, locals, &block)
448:       if @engine.respond_to?(:precompiled_method_return_value, true)
449:         super
450:       else
451:         @engine.render(scope, locals, &block)
452:       end
453:     end
initialize_engine() click to toggle source
     # File lib/sinatra/tilt.rb, line 437
437:     def initialize_engine
438:       return if defined? ::Haml::Engine
439:       require_template_library 'haml'
440:     end
precompiled_postamble(locals) click to toggle source
     # File lib/sinatra/tilt.rb, line 477
477:     def precompiled_postamble(locals)
478:       @engine.instance_eval do
479:                     #{precompiled_method_return_value}          ensure            @haml_buffer = @haml_buffer.upper          end
480:       end
481:     end
precompiled_preamble(locals) click to toggle source
     # File lib/sinatra/tilt.rb, line 462
462:     def precompiled_preamble(locals)
463:       local_assigns = super
464:       @engine.instance_eval do
465:                   begin            extend Haml::Helpers            _hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})            _erbout = _hamlout.buffer            __in_erb_template = true            _haml_locals = locals            #{local_assigns}
466:       end
467:     end
precompiled_template(locals) click to toggle source

Precompiled Haml source. Taken from the precompiled_with_ambles method in Haml::Precompiler: github.com/nex3/haml/blob/master/lib/haml/precompiler.rb#L111-126

     # File lib/sinatra/tilt.rb, line 458
458:     def precompiled_template(locals)
459:       @engine.precompiled
460:     end
prepare() click to toggle source
     # File lib/sinatra/tilt.rb, line 442
442:     def prepare
443:       options = @options.merge(:filename => eval_file, :line => line)
444:       @engine = ::Haml::Engine.new(data, options)
445:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.