class XMLInstantiatorTest::PruneTestInstantiator

Attributes

max_depth[R]

Public Instance Methods

calc_max_depth(node, offset) click to toggle source
# File lib/puppet/vendor/rgen/test/xml_instantiator_test.rb, line 60
def calc_max_depth(node, offset)
  if node.children.nil? || node.children.size == 0
    @max_depth = offset if offset > @max_depth
  else 
    node.children.each do |c|
      calc_max_depth(c, offset+1)
    end
  end
end
on_ascent(node) click to toggle source
# File lib/puppet/vendor/rgen/test/xml_instantiator_test.rb, line 56
def on_ascent(node)
  calc_max_depth(node, 0)
end
on_descent(node) click to toggle source
# File lib/puppet/vendor/rgen/test/xml_instantiator_test.rb, line 53
def on_descent(node)
end

Public Class Methods

new(env) click to toggle source
# File lib/puppet/vendor/rgen/test/xml_instantiator_test.rb, line 48
def initialize(env)
  super(env)
  @max_depth = 0
end