Sha256: 2062e50c9d00cbc402dad47c1517e3f0fce5b918cdd4f9821d7ecece175933a7
Contents?: true
Size: 508 Bytes
Versions: 6
Compression:
Stored size: 508 Bytes
Contents
# typed: false # frozen_string_literal: true require "packwerk/node" module Packwerk class NodeVisitor def initialize(node_processor:) @node_processor = node_processor end def visit(node, ancestors:, result:) offense = @node_processor.call(node, ancestors: ancestors) result << offense if offense child_ancestors = [node] + ancestors Node.each_child(node) do |child| visit(child, ancestors: child_ancestors, result: result) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems