Class: DepGraph::NodeFinders::TestNodeFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/nodefinders/test_node_finder.rb

Overview

This is a simple example of a custom node finder with a hard coded graph. Note that the file must be named [nodetype]_node_finder.rb containing a class named [Nodetype]NodeFinder To use this example do: depgraph -type test

Instance Method Summary collapse

Instance Method Details

#get_nodesObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/nodefinders/test_node_finder.rb', line 14

def get_nodes
  #let's return a hardcoded graph with 2 nodes and one dependency between them
  
  node1 = Node.new('node1')
  node2 = Node.new('node2')
  
  node1.depends_on(node2)
  
  return [node1, node2] 
end

#location=(loc) ⇒ Object



10
11
12
# File 'lib/nodefinders/test_node_finder.rb', line 10

def location=(loc)
  #we will ignore location in this example
end