Class: Yogurt::CodeGenerator::DefinedClassSorter

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
TSort
Defined in:
lib/yogurt/code_generator/defined_class_sorter.rb

Instance Method Summary collapse

Constructor Details

#initialize(classes) ⇒ DefinedClassSorter

Returns a new instance of DefinedClassSorter.



12
13
14
15
16
17
# File 'lib/yogurt/code_generator/defined_class_sorter.rb', line 12

def initialize(classes)
  @classes = T.let(
    classes.map {|k| [k.name, k]}.to_h,
    T::Hash[String, DefinedClass],
  )
end

Instance Method Details

#sorted_classesObject



20
21
22
# File 'lib/yogurt/code_generator/defined_class_sorter.rb', line 20

def sorted_classes
  tsort
end