Module: Jade::CompilationEssentials

Included in:
ShippedCompiler, SystemCompiler
Defined in:
lib/jade-ruby/compilation-essentials.rb

Overview

Used to share common things between compilers.

Instance Method Summary collapse

Instance Method Details

#process_result(source, result, options) ⇒ String

Responds for post-processing compilation result.

Parameters:

  • source (String)

    The source code of template.

  • result (String)

    The compiled code of template.

  • options (Hash)

    The compilation options.

Returns:

  • (String)

16
17
18
19
20
21
22
# File 'lib/jade-ruby/compilation-essentials.rb', line 16

def process_result(source, result, options)
  if options[:client]
    "(function(jade) { #{ super }; return #{ options[:name] }; }).call(this, jade);"
  else
    super
  end
end