Class: HamlToStar::CodeNode

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeCodeNode

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

#childrenArray<CodeNode>

Children of current line in haml

Returns:



15
16
17
# File 'lib/haml_to_star/code_node.rb', line 15

def children
  @children
end

#lineString

Current line in haml

Returns:

  • (String)


10
11
12
# File 'lib/haml_to_star/code_node.rb', line 10

def line
  @line
end

#line_numberInteger

The line number of the code element

Returns:

  • (Integer)


20
21
22
# File 'lib/haml_to_star/code_node.rb', line 20

def line_number
  @line_number
end