Class Roodi::Core::CheckingVisitor
In: lib/roodi/core/checking_visitor.rb
Parent: Object

Methods

new   visit  

Public Class methods

[Source]

# File lib/roodi/core/checking_visitor.rb, line 4
      def initialize(*checks)
        @checks ||= {}
        checks.first.each do |check|
          nodes = check.interesting_nodes
          nodes.each do |node|
            @checks[node] ||= []
            @checks[node] << check
            @checks[node].uniq!
          end
        end
      end

Public Instance methods

[Source]

# File lib/roodi/core/checking_visitor.rb, line 16
        def visit(node)
        checks = @checks[node.node_type]
        checks.each {|check| check.evaluate_node_start(node)} unless checks.nil?

                node.visitable_children.each {|sexp| sexp.accept(self)}

        checks.each {|check| check.evaluate_node_end(node)} unless checks.nil?
        end

[Validate]