Class: Necropsy::Reachability::Result
- Inherits:
-
Data
- Object
- Data
- Necropsy::Reachability::Result
- Defined in:
- lib/necropsy/reachability/engine.rb
Instance Attribute Summary collapse
-
#external_paths ⇒ Object
readonly
Returns the value of attribute external_paths.
-
#runtime_paths ⇒ Object
readonly
Returns the value of attribute runtime_paths.
-
#test_paths ⇒ Object
readonly
Returns the value of attribute test_paths.
Class Method Summary collapse
Instance Method Summary collapse
- #external_alive ⇒ Object
-
#initialize(runtime_paths:, test_paths:, external_paths: {}) ⇒ Result
constructor
A new instance of Result.
- #runtime_alive ⇒ Object
- #test_alive ⇒ Object
- #witness(node_id, kind: :runtime) ⇒ Object
Constructor Details
#initialize(runtime_paths:, test_paths:, external_paths: {}) ⇒ Result
Returns a new instance of Result.
19 20 21 |
# File 'lib/necropsy/reachability/engine.rb', line 19 def initialize(runtime_paths:, test_paths:, external_paths: {}) super end |
Instance Attribute Details
#external_paths ⇒ Object (readonly)
Returns the value of attribute external_paths
5 6 7 |
# File 'lib/necropsy/reachability/engine.rb', line 5 def external_paths @external_paths end |
#runtime_paths ⇒ Object (readonly)
Returns the value of attribute runtime_paths
5 6 7 |
# File 'lib/necropsy/reachability/engine.rb', line 5 def runtime_paths @runtime_paths end |
#test_paths ⇒ Object (readonly)
Returns the value of attribute test_paths
5 6 7 |
# File 'lib/necropsy/reachability/engine.rb', line 5 def test_paths @test_paths end |
Class Method Details
.data_new ⇒ Object
7 |
# File 'lib/necropsy/reachability/engine.rb', line 7 alias_method :data_new, :new |
.new(*values, **attributes) ⇒ Object Also known as: []
9 10 11 12 13 |
# File 'lib/necropsy/reachability/engine.rb', line 9 def new(*values, **attributes) return data_new(runtime_paths: values[0], test_paths: values[1], external_paths: {}) if values.length == 2 && attributes.empty? data_new(*values, **attributes) end |
Instance Method Details
#external_alive ⇒ Object
31 32 33 |
# File 'lib/necropsy/reachability/engine.rb', line 31 def external_alive external_paths.keys end |
#runtime_alive ⇒ Object
23 24 25 |
# File 'lib/necropsy/reachability/engine.rb', line 23 def runtime_alive runtime_paths.keys end |
#test_alive ⇒ Object
27 28 29 |
# File 'lib/necropsy/reachability/engine.rb', line 27 def test_alive test_paths.keys end |
#witness(node_id, kind: :runtime) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/necropsy/reachability/engine.rb', line 35 def witness(node_id, kind: :runtime) paths = paths_for(kind) return unless paths.key?(node_id) chain = [] current = node_id while current chain.unshift(current) current = paths[current] end chain end |