Class: Tache::Template
- Inherits:
-
Object
- Object
- Tache::Template
- Defined in:
- lib/tache/template.rb
Instance Method Summary collapse
- #compile ⇒ Object
- #compiled? ⇒ Boolean
-
#initialize(source, options = {}) ⇒ Template
constructor
A new instance of Template.
- #render(context, indent = '', blocks = {}) ⇒ Object
- #to_str ⇒ Object
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, = {}) @source = source @tags = [:tags] end |
Instance Method Details
#compile ⇒ Object
11 12 13 14 |
# File 'lib/tache/template.rb', line 11 def compile tokens self end |
#compiled? ⇒ 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_str ⇒ Object
20 21 22 |
# File 'lib/tache/template.rb', line 20 def to_str '[template]' end |