Class: HamlToStar::CodeNode
- Inherits:
-
Object
- Object
- HamlToStar::CodeNode
- Defined in:
- lib/haml_to_star/code_node.rb
Overview
This class is used only internally. It allows the compiler to construct the tree associated to the haml code. A code element is equivalent to a line in haml.
Instance Attribute Summary collapse
-
#children ⇒ Array<CodeNode>
Children of current line in haml.
-
#line ⇒ String
Current line in haml.
-
#line_number ⇒ Integer
The line number of the code element.
Instance Method Summary collapse
-
#initialize ⇒ CodeNode
constructor
A new instance of CodeNode.
Constructor Details
#initialize ⇒ CodeNode
Returns a new instance of CodeNode.
22 23 24 25 26 |
# File 'lib/haml_to_star/code_node.rb', line 22 def initialize @line = '' @line_number = 0 @children = [] end |
Instance Attribute Details
#children ⇒ Array<CodeNode>
Children of current line in haml
15 16 17 |
# File 'lib/haml_to_star/code_node.rb', line 15 def children @children end |
#line ⇒ String
Current line in haml
10 11 12 |
# File 'lib/haml_to_star/code_node.rb', line 10 def line @line end |
#line_number ⇒ Integer
The line number of the code element
20 21 22 |
# File 'lib/haml_to_star/code_node.rb', line 20 def line_number @line_number end |