Class: Tilt::HamlTemplate

### Home Classes Methods

### In Files

- lib/tilt/haml.rb

### Parent

Template

### Methods

- ::engine_initialized?
- #evaluate
- #initialize_engine
- #precompiled_postamble
- #precompiled_preamble
- #precompiled_template
- #prepare

### Class/Module Index

Quicksearch

- Tilt
- Tilt::AsciidoctorTemplate
- Tilt::BlueClothTemplate
- Tilt::BuilderTemplate
- Tilt::CSVTemplate
- Tilt::Cache
- Tilt::CoffeeScriptTemplate
- Tilt::CompileSite
- Tilt::CreoleTemplate
- Tilt::ERBTemplate
- Tilt::ErubisTemplate
- Tilt::EtanniTemplate
- Tilt::HamlTemplate
- Tilt::KramdownTemplate
- Tilt::LessTemplate
- Tilt::LiquidTemplate
- Tilt::MarkabyTemplate
- Tilt::MarukuTemplate
- Tilt::NokogiriTemplate
- Tilt::PlainTemplate
- Tilt::RDiscountTemplate
- Tilt::RDocTemplate
- Tilt::RadiusTemplate
- Tilt::RedClothTemplate
- Tilt::RedcarpetTemplate
- Tilt::RedcarpetTemplate::Redcarpet1
- Tilt::RedcarpetTemplate::Redcarpet2
- Tilt::SassTemplate
- Tilt::ScssTemplate
- Tilt::StringTemplate
- Tilt::Template
- Tilt::WikiClothTemplate
- Tilt::YajlTemplate

No matching classes.

# Tilt::HamlTemplate

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

### Public Class Methods

engine_initialized?() click to toggle source

    # File lib/tilt/haml.rb, line 9
    def self.engine_initialized?
      defined? ::Haml::Engine
    end

### Public Instance Methods

evaluate(scope, locals, &block) click to toggle source

    # File lib/tilt/haml.rb, line 22
    def evaluate(scope, locals, &block)
      if @engine.respond_to?(:precompiled_method_return_value, true)
        super
      else
        @engine.render(scope, locals, &block)
      end
    end

initialize_engine() click to toggle source

    # File lib/tilt/haml.rb, line 13
    def initialize_engine
      require_template_library 'haml'
    end

precompiled_postamble(locals) click to toggle source

    # File lib/tilt/haml.rb, line 52
    def precompiled_postamble(locals)
      @engine.instance_eval do
                    #{precompiled_method_return_value}          ensure            @haml_buffer = @haml_buffer.upper          end
      end
    end

precompiled_preamble(locals) click to toggle source

    # File lib/tilt/haml.rb, line 37
    def precompiled_preamble(locals)
      local_assigns = super
      @engine.instance_eval do
                  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}
      end
    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/tilt/haml.rb, line 33
    def precompiled_template(locals)
      @engine.precompiled
    end

prepare() click to toggle source

    # File lib/tilt/haml.rb, line 17
    def prepare
      options = @options.merge(:filename => eval_file, :line => line)
      @engine = ::Haml::Engine.new(data, options)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.