Class: Malt::Engine::Coffee

Inherits:
Abstract show all
Defined in:
lib/malt/engines/coffee.rb

Overview

Coffee Malt Engine

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, #create_engine, default, #initialize, #prepare_engine, register, type

Constructor Details

This class inherits a constructor from Malt::Engine::Abstract

Instance Method Details

#render(params = {}, &content) ⇒ Object

Render coffee script to JavaScript.


12
13
14
15
16
17
18
19
20
21
# File 'lib/malt/engines/coffee.rb', line 12

def render(params={}, &content)
  into, text, file = parameters(params, :to, :text, :file)

  case into
  when :javascript, :js, nil
    ::CoffeeScript.compile(text, engine_options(params))
  else
    super(params, &content)
  end
end