Method: RDoc::Parser::C#load_variable_map

Defined in:
lib/rdoc/parser/c.rb

#load_variable_map(map_name) ⇒ Object

Loads the variable map with the given name from the RDoc::Store, if present.



1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
# File 'lib/rdoc/parser/c.rb', line 1077

def load_variable_map map_name
  return {} unless files = @store.cache[map_name]
  return {} unless name_map = files[@file_name]

  class_map = {}

  name_map.each do |variable, name|
    next unless mod = @store.find_class_or_module(name)

    class_map[variable] = if map_name == :c_class_variables then
                            mod
                          else
                            name
                          end
    @known_classes[variable] = name
  end

  class_map
end