class Solargraph::ApiMap


the Ruby core.
An aggregate provider for information about Workspaces, Sources, gems, and

def self.load directory

Returns:
  • (ApiMap) -

Parameters:
  • directory (String) --
def self.load directory
  api_map = new
  workspace = Solargraph::Workspace.new(directory)
  # api_map.catalog Bench.new(workspace: workspace)

  library = Library.new(workspace)
  library.map!
  api_map.catalog library.bench
  api_map
end

def self.load_with_cache directory, out = IO::NULL

Returns:
  • (ApiMap) -

Parameters:
  • out (IO) -- The output stream for messages
  • directory (String) --

Other tags:
    Todo: - IO::NULL is incorrectly inferred to be a String.
def self.load_with_cache directory, out = IO::NULL
  api_map = load(directory)
  return api_map if api_map.uncached_gemspecs.empty?
  api_map.uncached_gemspecs.each do |gemspec|
    out.puts "Caching gem #{gemspec.name} #{gemspec.version}"
    pins = GemPins.build(gemspec)
    Solargraph::Cache.save('gems', "#{gemspec.name}-#{gemspec.version}.ser", pins)
  end
  load(directory)
end

def ==(other)

def ==(other)
  self.eql?(other)
end

def bundled? filename

Parameters:
  • filename (String) --
def bundled? filename
  source_map_hash.keys.include?(filename)
end

def can_resolve_generics?(namespace_pin, rooted_type)

Parameters:
  • rooted_type (ComplexType) --
  • namespace_pin (Pin::Namespace) --
def can_resolve_generics?(namespace_pin, rooted_type)
  has_generics?(namespace_pin) && !rooted_type.all_params.empty?
end

def catalog bench

Returns:
  • (self) -

Parameters:
  • bench (Bench) --
def catalog bench
  old_api_hash = @source_map_hash&.values&.map(&:api_hash)
  need_to_uncache = (old_api_hash != bench.source_maps.map(&:api_hash))
  @source_map_hash = bench.source_maps.map { |s| [s.filename, s] }.to_h
  pins = bench.source_maps.flat_map(&:pins).flatten
  implicit.clear
  source_map_hash.each_value do |map|
    implicit.merge map.environ
  end
  unresolved_requires = (bench.external_requires + implicit.requires + bench.workspace.config.required).to_a.compact.uniq
  if @unresolved_requires != unresolved_requires || @doc_map&.uncached_gemspecs&.any?
    @doc_map = DocMap.new(unresolved_requires, [], bench.workspace.rbs_collection_path) # @todo Implement gem preferences

    @unresolved_requires = unresolved_requires
    need_to_uncache = true
  end
  @store = Store.new(@@core_map.pins + @doc_map.pins + implicit.pins + pins)
  @cache.clear if need_to_uncache
  @missing_docs = [] # @todo Implement missing docs

  self
end

def clip cursor

Returns:
  • (SourceMap::Clip) -

Parameters:
  • cursor (Source::Cursor) --

Raises:
  • (FileNotFoundError) - if the cursor's file is not in the ApiMap
def clip cursor
  raise FileNotFoundError, "ApiMap did not catalog #{cursor.filename}" unless source_map_hash.key?(cursor.filename)
  SourceMap::Clip.new(self, cursor)
end

def clip_at filename, position

Returns:
  • (SourceMap::Clip) -

Parameters:
  • position (Position, Array(Integer, Integer)) --
  • filename (String) --
def clip_at filename, position
  position = Position.normalize(position)
  clip(cursor_at(filename, position))
end

def core_pins

Returns:
  • (Array) -
def core_pins
  @@core_map.pins
end

def cursor_at filename, position

Returns:
  • (Source::Cursor) -

Parameters:
  • position (Position, Array(Integer, Integer)) --
  • filename (String) --
def cursor_at filename, position
  position = Position.normalize(position)
  raise FileNotFoundError, "File not found: #{filename}" unless source_map_hash.key?(filename)
  source_map_hash[filename].cursor_at(position)
end

def document path

Returns:
  • (Enumerable) -

Parameters:
  • path (String) -- The path to find

Other tags:
    Todo: - This method is likely superfluous. Calling get_path_pins directly
def document path
  get_path_pins(path)
end

def document_symbols filename

Returns:
  • (Array) -

Parameters:
  • filename (String) --
def document_symbols filename
  return [] unless source_map_hash.key?(filename) # @todo Raise error?

  resolve_method_aliases source_map_hash[filename].document_symbols
end

def eql?(other)

def eql?(other)
  self.class == other.class &&
    equality_fields == other.equality_fields
end

def equality_fields

Other tags:
    Todo: - need to model type def statement in chains as a symbol so
def equality_fields
ass, @source_map_hash, implicit, @doc_map, @unresolved_requires, @missing_docs]

def erase_generics(namespace_pin, rooted_type, pins)

Returns:
  • (Array) -

Parameters:
  • pins (Enumerable) --
  • rooted_type (ComplexType) --
  • namespace_pin (Pin::Namespace) --
def erase_generics(namespace_pin, rooted_type, pins)
  return pins unless should_erase_generics_when_done?(namespace_pin, rooted_type)
  logger.debug("Erasing generics on namespace_pin=#{namespace_pin} / rooted_type=#{rooted_type}")
  pins.map do |method_pin|
    method_pin.erase_generics(namespace_pin.generics)
  end
end

def get_block_pins

Returns:
  • (Enumerable) -
def get_block_pins
  store.pins_by_class(Pin::Block)
end

def get_class_variable_pins(namespace)

Returns:
  • (Enumerable) -

Parameters:
  • namespace (String) -- A fully qualified namespace
def get_class_variable_pins(namespace)
  prefer_non_nil_variables(store.get_class_variables(namespace))
end

def get_complex_type_methods complex_type, context = '', internal = false

Returns:
  • (Array) -

Parameters:
  • internal (Boolean) -- True to include private methods
  • context (String) -- The context from which the type is referenced
  • complex_type (Solargraph::ComplexType) -- The complex type of the namespace
def get_complex_type_methods complex_type, context = '', internal = false
  # This method does not qualify the complex type's namespace because

  # it can cause conflicts between similar names, e.g., `Foo` vs.

  # `Other::Foo`. It still takes a context argument to determine whether

  # protected and private methods are visible.

  return [] if complex_type.undefined? || complex_type.void?
  result = Set.new
  complex_type.each do |type|
    if type.duck_type?
      result.add Pin::DuckMethod.new(name: type.to_s[1..-1])
      result.merge get_methods('Object')
    else
      unless type.nil? || type.name == 'void'
        visibility = [:public]
        if type.namespace == context || super_and_sub?(type.namespace, context)
          visibility.push :protected
          visibility.push :private if internal
        end
        result.merge get_methods(type.tag, scope: type.scope, visibility: visibility)
      end
    end
  end
  result.to_a
end

def get_constants namespace, *contexts

Returns:
  • (Array) -

Parameters:
  • contexts (Array) -- The contexts
  • namespace (String) -- The namespace
def get_constants namespace, *contexts
  namespace ||= ''
  contexts.push '' if contexts.empty?
  cached = cache.get_constants(namespace, contexts)
  return cached.clone unless cached.nil?
  skip = Set.new
  result = []
  contexts.each do |context|
    fqns = qualify(namespace, context)
    visibility = [:public]
    visibility.push :private if fqns == context
    result.concat inner_get_constants(fqns, visibility, skip)
  end
  cache.set_constants(namespace, contexts, result)
  result
end

def get_global_variable_pins

Returns:
  • (Enumerable) -
def get_global_variable_pins
  store.pins_by_class(Pin::GlobalVariable)
end

def get_instance_variable_pins(namespace, scope = :instance)

Returns:
  • (Array) -

Parameters:
  • scope (Symbol) -- :instance or :class
  • namespace (String) -- A fully qualified namespace
def get_instance_variable_pins(namespace, scope = :instance)
  result = []
  used = [namespace]
  result.concat store.get_instance_variables(namespace, scope)
  sc = qualify_lower(store.get_superclass(namespace), namespace)
  until sc.nil? || used.include?(sc)
    used.push sc
    result.concat store.get_instance_variables(sc, scope)
    sc = qualify_lower(store.get_superclass(sc), sc)
  end
  result
end

def get_method_stack rooted_tag, name, scope: :instance, visibility: [:private, :protected, :public], preserve_generics: false

Returns:
  • (Array) -

Parameters:
  • scope (Symbol) -- :instance or :class
  • name (String) -- Method name to look up
  • rooted_tag (String) -- Parameterized namespace, fully qualified
def get_method_stack rooted_tag, name, scope: :instance, visibility: [:private, :protected, :public], preserve_generics: false
  rooted_type = ComplexType.parse(rooted_tag)
  fqns = rooted_type.namespace
  namespace_pin = store.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
  methods = get_methods(rooted_tag, scope: scope, visibility: visibility).select { |p| p.name == name }
  methods = erase_generics(namespace_pin, rooted_type, methods) unless preserve_generics
  methods
end

def get_methods rooted_tag, scope: :instance, visibility: [:public], deep: true

Returns:
  • (Array) -

Parameters:
  • deep (Boolean) -- True to include superclasses, mixins, etc.
  • visibility (Array) -- :public, :protected, and/or :private
  • scope (Symbol) -- :class or :instance
  • rooted_tag (String) -- The fully qualified namespace to search for methods
def get_methods rooted_tag, scope: :instance, visibility: [:public], deep: true
  rooted_type = ComplexType.try_parse(rooted_tag)
  fqns = rooted_type.namespace
  namespace_pin = store.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
  cached = cache.get_methods(rooted_tag, scope, visibility, deep)
  return cached.clone unless cached.nil?
  result = []
  skip = Set.new
  if rooted_tag == ''
    # @todo Implement domains

    implicit.domains.each do |domain|
      type = ComplexType.try_parse(domain)
      next if type.undefined?
      result.concat inner_get_methods(type.name, type.scope, visibility, deep, skip)
    end
    result.concat inner_get_methods(rooted_tag, :class, visibility, deep, skip)
    result.concat inner_get_methods(rooted_tag, :instance, visibility, deep, skip)
    result.concat inner_get_methods('Kernel', :instance, visibility, deep, skip)
  else
    result.concat inner_get_methods(rooted_tag, scope, visibility, deep, skip)
    unless %w[Class Class<Class>].include?(rooted_tag)
      result.map! do |pin|
        next pin unless pin.path == 'Class#new'
        init_pin = get_method_stack(rooted_tag, 'initialize').first
        next pin unless init_pin
        type = ComplexType.try_parse(ComplexType.try_parse(rooted_tag).namespace)
        Pin::Method.new(
          name: 'new',
          scope: :class,
          location: init_pin.location,
          parameters: init_pin.parameters,
          signatures: init_pin.signatures.map { |sig| sig.proxy(type) },
          return_type: type,
          comments: init_pin.comments,
          closure: init_pin.closure
        # @todo Hack to force TypeChecker#internal_or_core?

        ).tap { |pin| pin.source = :rbs }
      end
    end
    result.concat inner_get_methods('Kernel', :instance, [:public], deep, skip) if visibility.include?(:private)
    result.concat inner_get_methods('Module', scope, visibility, deep, skip) if scope == :module
  end
  result = resolve_method_aliases(result, visibility)
  if namespace_pin && rooted_tag != rooted_type.name
    result = result.map { |method_pin| method_pin.resolve_generics(namespace_pin, rooted_type) }
  end
  cache.set_methods(rooted_tag, scope, visibility, deep, result)
  result
end

def get_namespace_pins namespace, context

Returns:
  • (Array) -

Parameters:
  • context (String) --
  • namespace (String) --
def get_namespace_pins namespace, context
  store.fqns_pins(qualify(namespace, context))
end

def get_namespace_type fqns

Returns:
  • (Symbol, nil) - :class, :module, or nil

Parameters:
  • fqns (String) -- A fully qualified namespace
def get_namespace_type fqns
  return nil if fqns.nil?
  # @type [Pin::Namespace, nil]

  pin = store.get_path_pins(fqns).select{|p| p.is_a?(Pin::Namespace)}.first
  return nil if pin.nil?
  pin.type
end

def get_path_pins path

Returns:
  • (Enumerable) -

Parameters:
  • path (String) --
def get_path_pins path
  get_path_suggestions(path)
end

def get_path_suggestions path

Returns:
  • (Enumerable) -

Parameters:
  • path (String) -- The path to find

Deprecated:
  • Use #get_path_pins instead.
def get_path_suggestions path
  return [] if path.nil?
  resolve_method_aliases store.get_path_pins(path)
end

def get_symbols

Returns:
  • (Enumerable) -
def get_symbols
  store.get_symbols
end

def has_generics?(namespace_pin)

Parameters:
  • namespace_pin (Pin::Namespace) --
def has_generics?(namespace_pin)
  namespace_pin && !namespace_pin.generics.empty?
end

def hash

def hash
  equality_fields.hash
end

def implicit

Returns:
  • (Environ) -
def implicit
  @implicit ||= Environ.new
end

def index pins

Returns:
  • (self) -

Parameters:
  • pins (Array) --
def index pins
  # @todo This implementation is incomplete. It should probably create a

  #   Bench.

  @source_map_hash = {}
  implicit.clear
  cache.clear
  @store = Store.new(@@core_map.pins + pins)
  self
end

def initialize pins: []

Parameters:
  • pins (Array) --
def initialize pins: []
  @source_map_hash = {}
  @cache = Cache.new
  @method_alias_stack = []
  index pins
end

def inner_get_constants fqns, visibility, skip

Returns:
  • (Array) -

Parameters:
  • skip (Set) --
  • visibility (Array) --
  • fqns (String) --
def inner_get_constants fqns, visibility, skip
  return [] if fqns.nil? || skip.include?(fqns)
  skip.add fqns
  result = []
  store.get_prepends(fqns).each do |is|
    result.concat inner_get_constants(qualify(is, fqns), [:public], skip)
  end
  result.concat store.get_constants(fqns, visibility)
                .sort { |a, b| a.name <=> b.name }
  store.get_includes(fqns).each do |is|
    result.concat inner_get_constants(qualify(is, fqns), [:public], skip)
  end
  fqsc = qualify_superclass(fqns)
  unless %w[Object BasicObject].include?(fqsc)
    result.concat inner_get_constants(fqsc, [:public], skip)
  end
  result
end

def inner_get_methods rooted_tag, scope, visibility, deep, skip, no_core = false

Returns:
  • (Array) -

Parameters:
  • no_core (Boolean) -- Skip core classes if true
  • skip (Set) --
  • deep (Boolean) --
  • visibility (Array) -- :public, :protected, and/or :private
  • scope (Symbol) -- :class or :instance
  • rooted_tag (String) -- A fully qualified namespace, with
def inner_get_methods rooted_tag, scope, visibility, deep, skip, no_core = false
  rooted_type = ComplexType.parse(rooted_tag).force_rooted
  fqns = rooted_type.namespace
  fqns_generic_params = rooted_type.all_params
  namespace_pin = store.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
  return [] if no_core && fqns =~ /^(Object|BasicObject|Class|Module)$/
  reqstr = "#{fqns}|#{scope}|#{visibility.sort}|#{deep}"
  return [] if skip.include?(reqstr)
  skip.add reqstr
  result = []
  if deep && scope == :instance
    store.get_prepends(fqns).reverse.each do |im|
      fqim = qualify(im, fqns)
      result.concat inner_get_methods(fqim, scope, visibility, deep, skip, true) unless fqim.nil?
    end
  end
  # Store#get_methods doesn't know about full tags, just

  # namespaces; resolving the generics in the method pins is this

  # class' responsibility

  methods = store.get_methods(fqns, scope: scope, visibility: visibility).sort{ |a, b| a.name <=> b.name }
  result.concat methods
  if deep
    if scope == :instance
      store.get_includes(fqns).reverse.each do |include_tag|
        rooted_include_tag = qualify(include_tag, rooted_tag)
        # Ensure the types returned by the included methods are

        # relative to the generics passed to the include.  e.g.,

        # Foo<String> might include Enumerable<String>

        #

        # @todo perform the same translation in the other areas

        #  here after adding a spec and handling things correctly

        #  in ApiMap::Store and RbsMap::Conversions

        resolved_include_type = ComplexType.parse(rooted_include_tag).force_rooted.resolve_generics(namespace_pin, rooted_type)
        methods = inner_get_methods(resolved_include_type.tag, scope, visibility, deep, skip, true)
        result.concat methods
      end
      fqsc = qualify_superclass(fqns)
      unless fqsc.nil?
        result.concat inner_get_methods(fqsc, scope, visibility, true, skip, no_core) unless fqsc.nil?
      end
    else
      store.get_extends(fqns).reverse.each do |em|
        fqem = qualify(em, fqns)
        result.concat inner_get_methods(fqem, :instance, visibility, deep, skip, true) unless fqem.nil?
      end
      fqsc = qualify_superclass(fqns)
      unless fqsc.nil?
        result.concat inner_get_methods(fqsc, scope, visibility, true, skip, true) unless fqsc.nil?
      end
      unless no_core || fqns.empty?
        type = get_namespace_type(fqns)
        result.concat inner_get_methods('Class', :instance, visibility, deep, skip, no_core) if type == :class
        result.concat inner_get_methods('Module', :instance, visibility, deep, skip, no_core)
      end
    end
    store.domains(fqns).each do |d|
      dt = ComplexType.try_parse(d)
      result.concat inner_get_methods(dt.namespace, dt.scope, visibility, deep, skip)
    end
  end
  result
end

def inner_qualify name, root, skip

Returns:
  • (String, nil) - Fully qualified ("rooted") namespace

Parameters:
  • skip (Set) -- Contexts already searched
  • root (String) -- The context to search
  • name (String) -- Namespace to fully qualify
def inner_qualify name, root, skip
  return name if name == ComplexType::GENERIC_TAG_NAME
  return nil if name.nil?
  return nil if skip.include?(root)
  skip.add root
  possibles = []
  if name == ''
    if root == ''
      return ''
    else
      return inner_qualify(root, '', skip)
    end
  else
    return name if root == '' && store.namespace_exists?(name)
    roots = root.to_s.split('::')
    while roots.length > 0
      fqns = roots.join('::') + '::' + name
      return fqns if store.namespace_exists?(fqns)
      incs = store.get_includes(roots.join('::'))
      incs.each do |inc|
        foundinc = inner_qualify(name, inc, skip)
        possibles.push foundinc unless foundinc.nil?
      end
      roots.pop
    end
    if possibles.empty?
      incs = store.get_includes('')
      incs.each do |inc|
        foundinc = inner_qualify(name, inc, skip)
        possibles.push foundinc unless foundinc.nil?
      end
    end
    return name if store.namespace_exists?(name)
    return possibles.last
  end
end

def keyword_pins

Returns:
  • (Enumerable) -
def keyword_pins
  store.pins_by_class(Pin::Keyword)
end

def locate_pins location

Returns:
  • (Array) -

Parameters:
  • location (Solargraph::Location) --
def locate_pins location
  return [] if location.nil? || !source_map_hash.key?(location.filename)
  resolve_method_aliases source_map_hash[location.filename].locate_pins(location)
end

def map source

Returns:
  • (self) -

Parameters:
  • source (Source) --
def map source
  map = Solargraph::SourceMap.map(source)
  catalog Bench.new(source_maps: [map])
  self
end

def named_macro name

Returns:
  • (YARD::Tags::MacroDirective, nil) -

Parameters:
  • name (String) --
def named_macro name
  store.named_macros[name]
end

def namespace_exists? name, context = ''

Returns:
  • (Boolean) -

Parameters:
  • context (String) -- The context to search
  • name (String) -- The namespace to match
def namespace_exists? name, context = ''
  !qualify(name, context).nil?
end

def namespaces

Returns:
  • (Set) -
def namespaces
  store.namespaces
end

def path_macros

Returns:
  • (Hash) -
def path_macros
  @path_macros ||= {}
end

def pins

Returns:
  • (Array) -
def pins
  store.pins
end

def prefer_non_nil_variables pins

Returns:
  • (Enumerable) -

Parameters:
  • pins (Enumerable) --
def prefer_non_nil_variables pins
  result = []
  nil_pins = []
  pins.each do |pin|
    if pin.variable? && pin.nil_assignment?
      nil_pins.push pin
    else
      result.push pin
    end
  end
  result + nil_pins
end

def qualify tag, context_tag = ''

Returns:
  • (String, nil) - fully qualified tag

Parameters:
  • context_tag (String) -- The fully qualified context in which
  • tag (String, nil) -- The namespace to
def qualify tag, context_tag = ''
  return tag if ['self', nil].include?(tag)
  context_type = ComplexType.parse(context_tag).force_rooted
  return unless context_type
  type = ComplexType.try_parse(tag)
  return unless type
  fqns = qualify_namespace(type.rooted_namespace, context_type.namespace)
  return unless fqns
  fqns + type.substring
end

def qualify_lower namespace, context

Returns:
  • (String, nil) -

Parameters:
  • context (String) --
  • namespace (String) --
def qualify_lower namespace, context
  qualify namespace, context.split('::')[0..-2].join('::')
end

def qualify_namespace(namespace, context_namespace = '')

Returns:
  • (String, nil) - fully qualified namespace

Parameters:
  • context_namespace (String) -- The context namespace in which the
  • namespace (String, nil) -- The namespace to
def qualify_namespace(namespace, context_namespace = '')
  cached = cache.get_qualified_namespace(namespace, context_namespace)
  return cached.clone unless cached.nil?
  result = if namespace.start_with?('::')
             inner_qualify(namespace[2..-1], '', Set.new)
           else
             inner_qualify(namespace, context_namespace, Set.new)
           end
  cache.set_qualified_namespace(namespace, context_namespace, result)
  result
end

def qualify_superclass fqsub

Returns:
  • (String, nil) -

Parameters:
  • fqsub (String) --
def qualify_superclass fqsub
  sup = store.get_superclass(fqsub)
  return nil if sup.nil?
  parts = fqsub.split('::')
  last = parts.pop
  parts.pop if last == sup
  qualify(sup, parts.join('::'))
end

def query_symbols query

Returns:
  • (Array) -

Parameters:
  • query (String) --
def query_symbols query
  Pin::Search.new(
    source_map_hash.values.flat_map(&:document_symbols),
    query
  ).results
end

def required

Returns:
  • (Set) -
def required
  @required ||= Set.new
end

def resolve_method_alias pin

Returns:
  • (Pin::Method) -

Parameters:
  • pin (Pin::MethodAlias, Pin::Base) --
def resolve_method_alias pin
  return pin unless pin.is_a?(Pin::MethodAlias)
  return nil if @method_alias_stack.include?(pin.path)
  @method_alias_stack.push pin.path
  origin = get_method_stack(pin.full_context.tag, pin.original, scope: pin.scope).first
  @method_alias_stack.pop
  return nil if origin.nil?
  args = {
    location: pin.location,
    closure: pin.closure,
    name: pin.name,
    comments: origin.comments,
    scope: origin.scope,
     context: pin.context,
    visibility: origin.visibility,
    signatures: origin.signatures,
    attribute: origin.attribute?,
    generics: origin.generics,
    return_type: origin.return_type,
  }
  Pin::Method.new **args
end

def resolve_method_aliases pins, visibility = [:public, :private, :protected]

Returns:
  • (Array) -

Parameters:
  • visibility (Enumerable) --
  • pins (Enumerable) --
def resolve_method_aliases pins, visibility = [:public, :private, :protected]
  pins.map do |pin|
    resolved = resolve_method_alias(pin)
    next pin if resolved.respond_to?(:visibility) && !visibility.include?(resolved.visibility)
    resolved
  end.compact
end

def search query

Returns:
  • (Array) -

Parameters:
  • query (String) -- The text to match
def search query
  pins.map(&:path)
      .compact
      .select { |path| path.downcase.include?(query.downcase) }
end

def should_erase_generics_when_done?(namespace_pin, rooted_type)

Parameters:
  • rooted_type (ComplexType) --
  • namespace_pin (Pin::Namespace) --
def should_erase_generics_when_done?(namespace_pin, rooted_type)
  has_generics?(namespace_pin) && !can_resolve_generics?(namespace_pin, rooted_type)
end

def source_map filename

Returns:
  • (SourceMap) -

Parameters:
  • filename (String) --
def source_map filename
  raise FileNotFoundError, "Source map for `#{filename}` not found" unless source_map_hash.key?(filename)
  source_map_hash[filename]
end

def source_maps

Returns:
  • (Array) -
def source_maps
  source_map_hash.values
end

def store

Returns:
  • (ApiMap::Store) -
def store
  @store ||= Store.new
end

def super_and_sub?(sup, sub)

Returns:
  • (Boolean) -

Parameters:
  • sub (String) -- The subclass
  • sup (String) -- The superclass
def super_and_sub?(sup, sub)
  fqsup = qualify(sup)
  cls = qualify(sub)
  tested = []
  until fqsup.nil? || cls.nil? || tested.include?(cls)
    return true if cls == fqsup
    tested.push cls
    cls = qualify_superclass(cls)
  end
  false
end

def type_include?(host_ns, module_ns)

Returns:
  • (Boolean) -

Parameters:
  • module_ns (String) -- The module namespace (no type parameters)
  • host_ns (String) -- The class namesapce (no type parameters)
def type_include?(host_ns, module_ns)
  store.get_includes(host_ns).map { |inc_tag| ComplexType.parse(inc_tag).name }.include?(module_ns)
end

def uncached_gemspecs

Returns:
  • (::Array) -
def uncached_gemspecs
  @doc_map&.uncached_gemspecs || []
end