Class: Tache::Template

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

Instance Method Summary collapse

Constructor Details

#initialize(source, options = {}) ⇒ Template

Returns a new instance of Template.



2
3
4
5
# File 'lib/tache/template.rb', line 2

def initialize(source, options = {})
  @source = source
  @tags = options[:tags]
end

Instance Method Details

#compileObject



11
12
13
14
# File 'lib/tache/template.rb', line 11

def compile
  tokens
  self
end

#compiled?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/tache/template.rb', line 16

def compiled?
  !!@tokens
end

#render(context, indent = '', blocks = {}) ⇒ Object



7
8
9
# File 'lib/tache/template.rb', line 7

def render(context, indent = '', blocks = {})
  render_tokens(tokens, context, indent, blocks)
end

#to_strObject



20
21
22
# File 'lib/tache/template.rb', line 20

def to_str
  '[template]'
end