Class: Faml::FilterCompilers::Coffee

Inherits:
TiltBase show all
Defined in:
lib/faml/filter_compilers/coffee.rb

Instance Method Summary collapse

Methods inherited from TiltBase

render_with_tilt

Methods inherited from Base

#need_newline?

Instance Method Details

#compile(ast) ⇒ Object



7
8
9
10
11
12
# File 'lib/faml/filter_compilers/coffee.rb', line 7

def compile(ast)
  temple = [:multi, [:static, "\n"], [:newline]]
  compile_with_tilt(temple, 'coffee', ast, indent_width: 2)
  temple << [:static, "\n"]
  [:haml, :tag, 'script', false, [:html, :attrs], [:html, :js, temple]]
end