class Jade::Processor

Public Class Methods

call(input) click to toggle source
# File lib/jade/processor.rb, line 8
def self.call(input)
  instance.call(input)
end
instance() click to toggle source
# File lib/jade/processor.rb, line 4
def self.instance
  @instance ||= new
end

Public Instance Methods

call(input) click to toggle source
# File lib/jade/processor.rb, line 12
    def call(input)
      namespace = 'this.JST'
      template = Jade::Renderer.compile(input[:data])

      <<-JS.strip_heredoc
        (function() {
          #{namespace} || (#{namespace} = {});
          #{namespace}[#{input[:name].inspect}] = #{template};
        }).call(this);
      JS
    end