Class: Liquidscript::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/liquidscript/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Template

Returns a new instance of Template.



6
7
8
# File 'lib/liquidscript/template.rb', line 6

def initialize(data)
  @data = data
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
# File 'lib/liquidscript/template.rb', line 10

def render
  @_render ||= begin
    compiler = Compiler::ICR.new(Scanner::Liquidscript.new(@data))
    compiler.compile
    puts ICR::Sexp.new(compiler.top).output
    Generator::Javascript.new(compiler.top).generate
  end
end