class Malt::Engine::Haml

Haml

Public Instance Methods

create_engine(params={}) click to toggle source
# File lib/malt/engines/haml.rb, line 26
def create_engine(params={})
  text, file = parameters(params, :text, :file)
  cached(text, file) do
    ::Haml::Engine.new(text, :filename=>file)
  end
end
render(params={}, &content) click to toggle source
Calls superclass method Malt::Engine::Abstract#render
# File lib/malt/engines/haml.rb, line 12
def render(params={}, &content)
  into, scope, locals = parameters(params, :to, :scope, :locals)

  scope, locals = make_ready(scope, locals, &content)

  case into
  when :html, nil
    prepare_engine(params, &content).render(scope, locals, &content)
  else
    super(params, &content)
  end
end

Private Instance Methods

require_engine() click to toggle source

Load Haml library if not already loaded.

# File lib/malt/engines/haml.rb, line 36
def require_engine
  return if defined? ::Haml::Engine
  require_library 'haml'
end