class Solargraph::ApiMap::Cache

def all_caches

def all_caches
  [@methods, @constants, @qualified_namespaces, @receiver_definitions, @clips]
end

def clear

Returns:
  • (void) -
def clear
  return if empty?
  all_caches.each(&:clear)
end

def empty?

Returns:
  • (Boolean) -
def empty?
  all_caches.all?(&:empty?)
end

def get_constants namespace, contexts

Returns:
  • (Array) -

Parameters:
  • contexts (Array) --
  • namespace (String) --
def get_constants namespace, contexts
  @constants["#{namespace}|#{contexts}"]
end

def get_methods fqns, scope, visibility, deep

Returns:
  • (Array) -

Parameters:
  • deep (Boolean) --
  • visibility (Array) --
  • scope (Symbol) --
  • fqns (String) --
def get_methods fqns, scope, visibility, deep
  @methods["#{fqns}|#{scope}|#{visibility}|#{deep}"]
end

def get_qualified_namespace name, context

Returns:
  • (String) -

Parameters:
  • context (String) --
  • name (String) --
def get_qualified_namespace name, context
  @qualified_namespaces["#{name}|#{context}"]
end

def get_receiver_definition path

Returns:
  • (Pin::Method) -

Parameters:
  • path (String) --
def get_receiver_definition path
  @receiver_definitions[path]
end

def initialize

def initialize
  # @type [Hash{Array => Array<Pin::Method>}]

  @methods = {}
  # @type [Hash{(String, Array<String>) => Array<Pin::Base>}]

  @constants = {}
  # @type [Hash{(String, String) => String}]

  @qualified_namespaces = {}
  # @type [Hash{String => Pin::Method}]

  @receiver_definitions = {}
  # @type [Hash{String => SourceMap::Clip}]

  @clips = {}
end

def set_constants namespace, contexts, value

Returns:
  • (void) -

Parameters:
  • value (Array) --
  • contexts (Array) --
  • namespace (String) --
def set_constants namespace, contexts, value
  @constants["#{namespace}|#{contexts}"] = value
end

def set_methods fqns, scope, visibility, deep, value

Returns:
  • (void) -

Parameters:
  • value (Array) --
  • deep (Boolean) --
  • visibility (Array) --
  • scope (Symbol) --
  • fqns (String) --
def set_methods fqns, scope, visibility, deep, value
  @methods["#{fqns}|#{scope}|#{visibility}|#{deep}"] = value
end

def set_qualified_namespace name, context, value

Returns:
  • (void) -

Parameters:
  • value (String) --
  • context (String) --
  • name (String) --
def set_qualified_namespace name, context, value
  @qualified_namespaces["#{name}|#{context}"] = value
end

def set_receiver_definition path, pin

Returns:
  • (void) -

Parameters:
  • pin (Pin::Method) --
  • path (String) --
def set_receiver_definition path, pin
  @receiver_definitions[path] = pin
end