class Solargraph::ApiMap::Cache

Public Class Methods

new() click to toggle source
# File lib/solargraph/api_map/cache.rb, line 5
def initialize
  @methods = {}
  @constants = {}
  @qualified_namespaces = {}
  @receiver_definitions = {}
end

Public Instance Methods

clear() click to toggle source

@return [void]

# File lib/solargraph/api_map/cache.rb, line 53
def clear
  @methods.clear
  @constants.clear
  @qualified_namespaces.clear
  @receiver_definitions.clear
end
empty?() click to toggle source

@return [Boolean]

# File lib/solargraph/api_map/cache.rb, line 61
def empty?
  @methods.empty? &&
    @constants.empty? &&
    @qualified_namespaces.empty? &&
    @receiver_definitions.empty?
end
get_constants(namespace, context) click to toggle source

@return [Array<Pin::Base>]

# File lib/solargraph/api_map/cache.rb, line 22
def get_constants namespace, context
  @constants[[namespace, context]]
end
get_methods(fqns, scope, visibility, deep) click to toggle source

@return [Array<Pin::Method>]

# File lib/solargraph/api_map/cache.rb, line 13
def get_methods fqns, scope, visibility, deep
  @methods[[fqns, scope, visibility.sort, deep]]
end
get_qualified_namespace(name, context) click to toggle source

@return [String]

# File lib/solargraph/api_map/cache.rb, line 31
def get_qualified_namespace name, context
  @qualified_namespaces[[name, context]]
end
get_receiver_definition(path) click to toggle source

@return [Pin::Method]

# File lib/solargraph/api_map/cache.rb, line 44
def get_receiver_definition path
  @receiver_definitions[path]
end
receiver_defined?(path) click to toggle source
# File lib/solargraph/api_map/cache.rb, line 39
def receiver_defined? path
  @receiver_definitions.key? path
end
set_constants(namespace, context, value) click to toggle source
# File lib/solargraph/api_map/cache.rb, line 26
def set_constants namespace, context, value
  @constants[[namespace, context]] = value
end
set_methods(fqns, scope, visibility, deep, value) click to toggle source
# File lib/solargraph/api_map/cache.rb, line 17
def set_methods fqns, scope, visibility, deep, value
  @methods[[fqns, scope, visibility.sort, deep]] = value
end
set_qualified_namespace(name, context, value) click to toggle source
# File lib/solargraph/api_map/cache.rb, line 35
def set_qualified_namespace name, context, value
  @qualified_namespaces[[name, context]] = value
end
set_receiver_definition(path, pin) click to toggle source
# File lib/solargraph/api_map/cache.rb, line 48
def set_receiver_definition path, pin
  @receiver_definitions[path] = pin
end