class Solargraph::ApiMap::Cache
Public Class Methods
new()
click to toggle source
# File lib/solargraph/api_map/cache.rb, line 6 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 54 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 62 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 23 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 14 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 32 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 45 def get_receiver_definition path @receiver_definitions[path] end
receiver_defined?(path)
click to toggle source
# File lib/solargraph/api_map/cache.rb, line 40 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 27 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 18 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 36 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 49 def set_receiver_definition path, pin @receiver_definitions[path] = pin end