class JinyuDebugTools::CodeParser::CodeNode
Public Class Methods
new(name)
click to toggle source
# File lib/utils/code_parser.rb, line 5 def initialize(name) @name = name @children = [] end
Public Instance Methods
append_child(child_node)
click to toggle source
# File lib/utils/code_parser.rb, line 22 def append_child(child_node) @children << child_node end
delete_child(child_node)
click to toggle source
# File lib/utils/code_parser.rb, line 52 def delete_child(child_node) @children.delete(child_node) end
get_index()
click to toggle source
# File lib/utils/code_parser.rb, line 34 def get_index @index end
get_level()
click to toggle source
# File lib/utils/code_parser.rb, line 30 def get_level @level end
get_name()
click to toggle source
# File lib/utils/code_parser.rb, line 10 def get_name @name end
get_parent()
click to toggle source
# File lib/utils/code_parser.rb, line 14 def get_parent @parent end
set_index(list_index)
click to toggle source
# File lib/utils/code_parser.rb, line 38 def set_index(list_index) @index = list_index end
set_level(level)
click to toggle source
# File lib/utils/code_parser.rb, line 26 def set_level(level) @level = level end
set_parent(parent_node)
click to toggle source
# File lib/utils/code_parser.rb, line 18 def set_parent(parent_node) @parent = parent_node end
to_hash()
click to toggle source
# File lib/utils/code_parser.rb, line 46 def to_hash children = @children.map(&:to_hash) children = nil if children.empty? {@name => children} end
to_s()
click to toggle source
# File lib/utils/code_parser.rb, line 42 def to_s @name end