Class: RubyIndexer::Entry::UnresolvedConstantAlias

Inherits:
RubyIndexer::Entry show all
Defined in:
lib/ruby_indexer/lib/ruby_indexer/entry.rb

Overview

An UnresolvedAlias points to a constant alias with a right hand side that has not yet been resolved. For example, if we find

“‘ruby

CONST = Foo

“‘ Before we have discovered Foo, there’s no way to eagerly resolve this alias to the correct target constant. All aliases are inserted as UnresolvedAlias in the index first and then we lazily resolve them to the correct target in [Index#resolve]. If the right hand side contains a constant that doesn’t exist, then it’s not possible to resolve the alias and it will remain an UnresolvedAlias until the right hand side constant exists

Instance Attribute Summary collapse

Attributes inherited from RubyIndexer::Entry

#configuration, #location, #name, #uri, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Entry

#comments, #file_name, #file_path, #private?, #protected?, #public?

Constructor Details

#initialize(configuration, target, nesting, name, uri, location, comments) ⇒ UnresolvedConstantAlias

: (Configuration configuration, String target, Array nesting, String name, URI::Generic uri, Location location, String? comments) -> void



374
375
376
377
378
379
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 374

def initialize(configuration, target, nesting, name, uri, location, comments) # rubocop:disable Metrics/ParameterLists
  super(configuration, name, uri, location, comments)

  @target = target
  @nesting = nesting
end

Instance Attribute Details

#nestingObject (readonly)

: Array



371
372
373
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 371

def nesting
  @nesting
end

#targetObject (readonly)

: String



368
369
370
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 368

def target
  @target
end