123456789_123456789_123456789_123456789_123456789_

Class: RBS::Environment::UseMap::Table

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/environment/use_map.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newTable

[ GitHub ]

  
# File 'lib/rbs/environment/use_map.rb', line 9

def initialize
  @known_types = Set[]
  @children = {}
end

Instance Attribute Details

#children (readonly)

[ GitHub ]

  
# File 'lib/rbs/environment/use_map.rb', line 7

attr_reader :known_types, :children

#known_types (readonly)

[ GitHub ]

  
# File 'lib/rbs/environment/use_map.rb', line 7

attr_reader :known_types, :children

Instance Method Details

#compute_children

[ GitHub ]

  
# File 'lib/rbs/environment/use_map.rb', line 14

def compute_children
  children.clear

  known_types.each do |type|
    unless type.namespace.empty?
      children[type.namespace] ||= Set[]
      children[type.namespace] << type
    end
  end

  self
end