Class: Hiptest::Nodes::ParentAdder

Inherits:
Walker
  • Object
show all
Defined in:
lib/hiptest-publisher/parent_adder.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Walker

#initialize

Constructor Details

This class inherits a constructor from Hiptest::Nodes::Walker

Class Method Details

.add(project) ⇒ Object



4
5
6
# File 'lib/hiptest-publisher/parent_adder.rb', line 4

def self.add(project)
  Hiptest::Nodes::ParentAdder.new().walk_node(project)
end

Instance Method Details

#walk_node(node) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/hiptest-publisher/parent_adder.rb', line 8

def walk_node(node)
  super(node)
  return unless node.is_a? Hiptest::Nodes::Node

  node.direct_children.each {|child|
    child.parent = node
  }
end