Class: Datadog::Configuration::DependencyResolver
- Inherits:
-
Object
- Object
- Datadog::Configuration::DependencyResolver
- Includes:
- TSort
- Defined in:
- lib/ddtrace/configuration/dependency_resolver.rb
Overview
Resolver performs a topological sort over the dependency graph
Instance Method Summary collapse
-
#initialize(dependency_graph = {}) ⇒ DependencyResolver
constructor
A new instance of DependencyResolver.
- #tsort_each_child(node, &blk) ⇒ Object
- #tsort_each_node(&blk) ⇒ Object
Constructor Details
#initialize(dependency_graph = {}) ⇒ DependencyResolver
Returns a new instance of DependencyResolver.
9 10 11 |
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 9 def initialize(dependency_graph = {}) @dependency_graph = dependency_graph end |
Instance Method Details
#tsort_each_child(node, &blk) ⇒ Object
17 18 19 |
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 17 def tsort_each_child(node, &blk) @dependency_graph.fetch(node).each(&blk) end |
#tsort_each_node(&blk) ⇒ Object
13 14 15 |
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 13 def tsort_each_node(&blk) @dependency_graph.each_key(&blk) end |