Class: Necropsy::Reachability::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#runtime_pathsObject (readonly)

Returns the value of attribute runtime_paths

Returns:

  • (Object)

    the current value of runtime_paths



5
6
7
# File 'lib/necropsy/reachability/engine.rb', line 5

def runtime_paths
  @runtime_paths
end

#test_pathsObject (readonly)

Returns the value of attribute test_paths

Returns:

  • (Object)

    the current value of test_paths



5
6
7
# File 'lib/necropsy/reachability/engine.rb', line 5

def test_paths
  @test_paths
end

Instance Method Details

#runtime_aliveObject



6
7
8
# File 'lib/necropsy/reachability/engine.rb', line 6

def runtime_alive
  runtime_paths.keys
end

#test_aliveObject



10
11
12
# File 'lib/necropsy/reachability/engine.rb', line 10

def test_alive
  test_paths.keys
end

#witness(node_id, kind: :runtime) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/necropsy/reachability/engine.rb', line 14

def witness(node_id, kind: :runtime)
  paths = kind == :runtime ? runtime_paths : test_paths
  return unless paths.key?(node_id)

  chain = []
  current = node_id
  while current
    chain.unshift(current)
    current = paths[current]
  end
  chain
end