Sha256: 3ddea9c523f60cdceeda44f9eccd575cbab3b518e7a131819898bb5b46c039ef

Contents?: true

Size: 490 Bytes

Versions: 13

Compression:

Stored size: 490 Bytes

Contents

# -*- coding: utf-8 -*-
module TreeRb
  #
  # Print for every node the name
  #
  class FlatPrintTreeNodeVisitor # < BasicTreeNodeVisitor

    def enter_node( tree_node )
      puts tree_node.name
    end

    def exit_node( tree_node )
    end

    #
    # called when the tree node is not accessible or an exception is raise when the node is accessed
    #
    def cannot_enter_node( tree_node, error)
    end

    def visit_leaf( leaf_node )
      puts leaf_node.name
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tree.rb-0.3.13 lib/tree_rb/visitors/flat_print_tree_node_visitor.rb
tree.rb-0.3.12 lib/tree_rb/visitors/flat_print_tree_node_visitor.rb
tree.rb-0.3.11 lib/tree_rb/visitors/flat_print_tree_node_visitor.rb
tree.rb-0.3.10 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.9 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.8 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.7 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.6 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.5 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.4 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.3 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.2 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
tree.rb-0.3.1 lib/tree_rb/visitors/flat_print_tree_node_visitors.rb