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

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

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

#childrenHash[Namespace, Set[TypeName]] (readonly)

Returns the value of attribute children.

Returns:



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

def children
  @children
end

#known_typesSet[TypeName] (readonly)

Returns the value of attribute known_types.

Returns:



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

def known_types
  @known_types
end

Instance Method Details

#compute_childrenself

Returns:

  • (self)


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