Module: Haml::Filters::TiltFilter

### Home Classes Methods

### In Files

- lib/haml/filters.rb

### Methods

- ::extended
- #template_class

### Class/Module Index

Quicksearch

- Haml
- Haml::Buffer
- Haml::Compiler
- Haml::Engine
- Haml::Error
- Haml::ErubisTemplateHandler
- Haml::Exec
- Haml::Exec::Generic
- Haml::Exec::Haml
- Haml::Filters
- Haml::Filters::Base
- Haml::Filters::Cdata
- Haml::Filters::Css
- Haml::Filters::Erb
- Haml::Filters::Escaped
- Haml::Filters::Javascript
- Haml::Filters::Plain
- Haml::Filters::PrecompiledTiltFilter
- Haml::Filters::Preserve
- Haml::Filters::Ruby
- Haml::Filters::SassRailsTemplate
- Haml::Filters::ScssRailsTemplate
- Haml::Filters::TiltFilter
- Haml::Helpers
- Haml::Helpers::ActionViewExtensions
- Haml::Helpers::ErrorReturn
- Haml::Helpers::XssMods
- Haml::Options
- Haml::Parser
- Haml::Parser::Line
- Haml::Parser::ParseNode
- Haml::Plugin
- Haml::Railtie
- Haml::SafeErubisTemplate
- Haml::SyntaxError
- Haml::Template
- Haml::Util
- Haml::Util::StaticConditionalContext
- ActionView
- ActionView::Base
- ActionView::Helpers
- ActionView::Helpers::CaptureHelper
- ActionView::Helpers::FormHelper
- ActionView::Helpers::FormTagHelper
- ActionView::Helpers::HamlSupport
- ActionView::Helpers::InstanceTag
- ActionView::Helpers::TagHelper
- ActionView::Helpers::Tags
- ActionView::Helpers::Tags::TextArea
- ActionView::Helpers::TextHelper
- Object

No matching classes.

# Haml::Filters::TiltFilter

@private

### Attributes

options[RW]
template_class[W]
tilt_extension[RW]

### Public Class Methods

extended(base) click to toggle source

    # File lib/haml/filters.rb, line 334
    def self.extended(base)
      base.options = {}
      # There's a bug in 1.9.2 where the same parse tree cannot be shared
      # across several singleton classes -- this bug is fixed in 1.9.3.
      # We work around this by using a string eval instead of a block eval
      # so that a new parse tree is created for each singleton class.
      base.instance_eval %{
        include Base

        def render_with_options(text, compiler_options)
          text = template_class.new(nil, 1, options) {text}.render
          super(text, compiler_options)
        end
      }
    end

### Public Instance Methods

template_class() click to toggle source

    # File lib/haml/filters.rb, line 324
    def template_class
      (@template_class if defined? @template_class) or begin
        @template_class = Tilt["t.#{tilt_extension}"] or
          raise Error.new(Error.message(:cant_run_filter, tilt_extension))
      rescue LoadError => e
        dep = e.message.split('--').last.strip
        raise Error.new(Error.message(:gem_install_filter_deps, tilt_extension, dep))
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.