class Solargraph::ApiMap::Cache
Public Class Methods
Source
# File lib/solargraph/api_map/cache.rb, line 6 def initialize # @type [Hash{String => Array<Pin::Method>}] @methods = {} # @type [Hash{String, Array<String> => Array<Pin::Base>}] @constants = {} # @type [Hash{String => String}] @qualified_namespaces = {} # @type [Hash{String => Pin::Method}] @receiver_definitions = {} # @type [Hash{String => SourceMap::Clip}] @clips = {} end
Public Instance Methods
Source
# File lib/solargraph/api_map/cache.rb, line 91 def clear return if empty? all_caches.each(&:clear) end
@return [void]
Source
# File lib/solargraph/api_map/cache.rb, line 98 def empty? all_caches.all?(&:empty?) end
@return [Boolean]
Source
# File lib/solargraph/api_map/cache.rb, line 50 def get_constants namespace, contexts @constants["#{namespace}|#{contexts}"] end
@param namespace [String] @param contexts [Array<String>] @return [Array<Pin::Base>]
Source
# File lib/solargraph/api_map/cache.rb, line 33 def get_methods fqns, scope, visibility, deep @methods["#{fqns}|#{scope}|#{visibility}|#{deep}"] end
@param fqns [String] @param scope [Symbol] @param visibility [Array<Symbol>] @param deep [Boolean] @return [Array<Pin::Method>]
Source
# File lib/solargraph/api_map/cache.rb, line 65 def get_qualified_namespace name, context @qualified_namespaces["#{name}|#{context}"] end
@param name [String] @param context [String] @return [String]
Source
# File lib/solargraph/api_map/cache.rb, line 79 def get_receiver_definition path @receiver_definitions[path] end
@param path [String] @return [Pin::Method]
Source
# File lib/solargraph/api_map/cache.rb, line 24 def inspect to_s end
avoid enormous dump
Source
# File lib/solargraph/api_map/cache.rb, line 58 def set_constants namespace, contexts, value @constants["#{namespace}|#{contexts}"] = value end
@param namespace [String] @param contexts [Array<String>] @param value [Array<Pin::Base>] @return [void]
Source
# File lib/solargraph/api_map/cache.rb, line 43 def set_methods fqns, scope, visibility, deep, value @methods["#{fqns}|#{scope}|#{visibility}|#{deep}"] = value end
@param fqns [String] @param scope [Symbol] @param visibility [Array<Symbol>] @param deep [Boolean] @param value [Array<Pin::Method>] @return [void]
Source
# File lib/solargraph/api_map/cache.rb, line 73 def set_qualified_namespace name, context, value @qualified_namespaces["#{name}|#{context}"] = value end
@param name [String] @param context [String] @param value [String] @return [void]
Source
# File lib/solargraph/api_map/cache.rb, line 86 def set_receiver_definition path, pin @receiver_definitions[path] = pin end
@param path [String] @param pin [Pin::Method] @return [void]
Private Instance Methods
Source
# File lib/solargraph/api_map/cache.rb, line 105 def all_caches [@methods, @constants, @qualified_namespaces, @receiver_definitions, @clips] end
@return [Array<Object>]