Class: Necropsy::Reachability::Engine
- Inherits:
-
Object
- Object
- Necropsy::Reachability::Engine
- Defined in:
- lib/necropsy/reachability/engine.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(graph, projection: :conservative, scope: nil) ⇒ Engine
constructor
A new instance of Engine.
Constructor Details
#initialize(graph, projection: :conservative, scope: nil) ⇒ Engine
Returns a new instance of Engine.
61 62 63 64 65 |
# File 'lib/necropsy/reachability/engine.rb', line 61 def initialize(graph, projection: :conservative, scope: nil) @graph = graph @projection = EvidenceStore.normalize_projection(projection) @scope = scope end |
Instance Method Details
#call ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'lib/necropsy/reachability/engine.rb', line 67 def call roots = graph.entry_points.group_by(&:domain) Result.new( runtime_paths: traverse(roots.fetch(:runtime, []).map(&:node_id), domain: :runtime), test_paths: traverse(roots.fetch(:test, []).map(&:node_id), domain: :test), external_paths: traverse(roots.fetch(:external, []).map(&:node_id), domain: :external) ) end |