123456789_123456789_123456789_123456789_123456789_

Class: RBS::DefinitionBuilder::MethodBuilder::Methods::Sorter

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, TSort
Inherits: Object
Defined in: lib/rbs/definition_builder/method_builder.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(methods) ⇒ Sorter

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 62

def initialize(methods)
  @methods = methods
end

Instance Attribute Details

#methods (readonly)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 60

attr_reader :methods

Instance Method Details

#tsort_each_child(defn)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 70

def tsort_each_child(defn)
  if (member = defn.original).is_a?(AST::Members::Alias)
    if old = methods[member.old_name]
      yield old
    end
  end
end

#tsort_each_node(&block)

[ GitHub ]

  
# File 'lib/rbs/definition_builder/method_builder.rb', line 66

def tsort_each_node(&block)
  methods.each_value(&block)
end