Class: Haml::Plugin

### Home Classes Methods

### In Files

- lib/haml/template/plugin.rb

### Parent

ActionView::Template::Handlers::ERB.superclass

### Methods

- ::call
- #cache_fragment
- #compile
- #handles_encoding?

### Included Modules

- ActionView::Template::Handlers::Compilable

### 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::Plugin

This module makes Haml work with Rails using the template handler API.

### Public Class Methods

call(template) click to toggle source

In Rails 3.1+, call takes the place of compile

    # File lib/haml/template/plugin.rb, line 29
    def self.call(template)
      new.compile(template)
    end

### Public Instance Methods

cache_fragment(block, name = {}, options = nil) click to toggle source

    # File lib/haml/template/plugin.rb, line 33
    def cache_fragment(block, name = {}, options = nil)
      @view.fragment_for(block, name, options) do
        eval("_hamlout.buffer", block.binding)
      end
    end

compile(template) click to toggle source

    # File lib/haml/template/plugin.rb, line 17
    def compile(template)
      options = Haml::Template.options.dup
      if (ActionPack::VERSION::MAJOR >= 4) && template.respond_to?(:type)
        options[:mime_type] = template.type
      elsif template.respond_to? :mime_type
        options[:mime_type] = template.mime_type
      end
      options[:filename] = template.identifier
      Haml::Engine.new(template.source, options).compiler.precompiled_with_ambles([])
    end

handles_encoding?() click to toggle source

    # File lib/haml/template/plugin.rb, line 15
    def handles_encoding?; true; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.