Class: Walrus::Compiler
- Inherits:
-
Object
- Object
- Walrus::Compiler
- Defined in:
- lib/walrus/compiler.rb
Defined Under Namespace
Classes: Instance
Constant Summary collapse
- BODY_INDENT =
' ' * 8
- OUTSIDE_INDENT =
' ' * 6
- DEFAULT_CLASS =
'DocumentSubclass'
Instance Method Summary collapse
-
#compile(tree, options = {}) ⇒ Object
Walks the Abstract Syntax Tree, tree, that represents a parsed Walrus template.
Instance Method Details
#compile(tree, options = {}) ⇒ Object
Walks the Abstract Syntax Tree, tree, that represents a parsed Walrus template.
Returns a String that defines a Document subclass corresponding to the compiled version of the tree.
137 138 139 |
# File 'lib/walrus/compiler.rb', line 137 def compile(tree, = {}) Instance.new().compile(tree) end |