module RuboCop::Cop::Util
def on_node(syms, sexp, excludes = [], &block)
def on_node(syms, sexp, excludes = [], &block) return to_enum(:on_node, syms, sexp, excludes) unless block_given? yield sexp if Array(syms).include?(sexp.type) return if Array(excludes).include?(sexp.type) sexp.each_child_node { |elem| on_node(syms, elem, excludes, &block) } end