Class: RBS::Environment::UseMap::Table
- Inherits:
-
Object
- Object
- RBS::Environment::UseMap::Table
- Defined in:
- lib/rbs/environment/use_map.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#known_types ⇒ Object
readonly
Returns the value of attribute known_types.
Instance Method Summary collapse
- #compute_children ⇒ Object
-
#initialize ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize ⇒ Table
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
#children ⇒ Object (readonly)
Returns the value of attribute children.
7 8 9 |
# File 'lib/rbs/environment/use_map.rb', line 7 def children @children end |
#known_types ⇒ Object (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_children ⇒ Object
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 |