Class: TreeRb::BasicTreeNodeVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_rb/core/basic_tree_node_visitor.rb

Overview

Callback methods used to visit a tree Are empty so it is possible to define only a subset when deriving subclass

Instance Method Summary collapse

Instance Method Details

#cannot_enter_node(tree_node, error) ⇒ Object

called when the tree node is not accessible or an exception is raise when the node is accessed



18
19
# File 'lib/tree_rb/core/basic_tree_node_visitor.rb', line 18

def cannot_enter_node( tree_node, error)
end

#cannot_visit_leaf(tree_node, error) ⇒ Object

called when the leaf node is not accessible or an exception is raise when the node is accessed



40
41
# File 'lib/tree_rb/core/basic_tree_node_visitor.rb', line 40

def cannot_visit_leaf( tree_node, error)
end

#enter_node(tree_node) ⇒ Object

called on tree node at start of the visit i.e. we start to visit the subtree



12
13
# File 'lib/tree_rb/core/basic_tree_node_visitor.rb', line 12

def enter_node( tree_node )
end

#exit_node(tree_node) ⇒ Object

called on tree node at end of the visit i.e. oll subtree are visited



26
27
# File 'lib/tree_rb/core/basic_tree_node_visitor.rb', line 26

def exit_node( tree_node )
end

#visit_leaf(leaf_node) ⇒ Object

called when visit leaf node



34
35
# File 'lib/tree_rb/core/basic_tree_node_visitor.rb', line 34

def visit_leaf( leaf_node )
end