Class: Necropsy::Reachability::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/necropsy/reachability/engine.rb

Instance Method Summary collapse

Constructor Details

#initialize(graph) ⇒ Engine

Returns a new instance of Engine.



29
30
31
# File 'lib/necropsy/reachability/engine.rb', line 29

def initialize(graph)
  @graph = graph
end

Instance Method Details

#callObject



33
34
35
36
37
38
39
40
41
# File 'lib/necropsy/reachability/engine.rb', line 33

def call
  runtime_roots = graph.entry_points.reject(&:test?).map(&:node_id)
  test_roots = graph.entry_points.select(&:test?).map(&:node_id)

  Result.new(
    runtime_paths: traverse(runtime_roots),
    test_paths: traverse(test_roots)
  )
end