Method: Wads::Node#find_node

Defined in:
lib/wads/data_structures.rb

#find_node(search_name) ⇒ Object



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/wads/data_structures.rb', line 380

def find_node(search_name)
    if @name == search_name
        return self
    end
    found_node_in_child = nil
    
    @outputs.each do |child|
        if child.is_a? Edge 
            child = child.destination 
        end
        found_node_in_child = child.find_node(search_name)
        if found_node_in_child
            return found_node_in_child
        end 
    end
    nil
end