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

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/environment/use_map.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTable

Returns a new instance of Table.



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

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

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



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

def children
  @children
end

#known_typesObject (readonly)

Returns the value of attribute known_types.



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

def known_types
  @known_types
end

Instance Method Details

#compute_childrenObject



14
15
16
17
18
19
20
21
22
23
24
25
# 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