Class: Ryac::Pipeline::Concatenator::GraphSorter

Inherits:
Object
  • Object
show all
Includes:
TSort, TSort[String]
Defined in:
lib/ryac/pipeline/concatenator.rb,
sig/ryac/pipeline/concatenator.rbs

Overview

Helper class for TSort

Instance Method Summary collapse

Constructor Details

#initialize(graph) ⇒ GraphSorter

Returns a new instance of GraphSorter.

Parameters:



86
87
88
# File 'lib/ryac/pipeline/concatenator.rb', line 86

def initialize(graph)
  @graph = graph
end

Instance Method Details

#tsort_each_child(node) {|arg0| ... } ⇒ void

This method returns an undefined value.

Parameters:

  • node (String)

Yields:

Yield Parameters:

  • arg0 (String)

Yield Returns:

  • (void)


94
95
96
97
98
99
100
# File 'lib/ryac/pipeline/concatenator.rb', line 94

def tsort_each_child(node, &block)
  entry = @graph[node]
  return unless entry

  entry.dependencies.each(&block)
  entry.in_class_dependencies.each(&block)
end

#tsort_each_node {|arg0| ... } ⇒ void

This method returns an undefined value.

Yields:

Yield Parameters:

  • arg0 (String)

Yield Returns:

  • (void)


90
91
92
# File 'lib/ryac/pipeline/concatenator.rb', line 90

def tsort_each_node(&block)
  @graph.paths.each(&block)
end