Class: RubyIndexer::Entry::MethodAlias

Inherits:
RubyIndexer::Entry show all
Extended by:
T::Sig
Defined in:
lib/ruby_indexer/lib/ruby_indexer/entry.rb

Overview

A method alias is a resolved alias entry that points to the exact method target it refers to

Instance Attribute Summary collapse

Attributes inherited from RubyIndexer::Entry

#comments, #file_path, #location, #name, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Entry

#file_name, #private?, #protected?, #public?

Constructor Details

#initialize(target, unresolved_alias) ⇒ MethodAlias

Returns a new instance of MethodAlias.



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 532

def initialize(target, unresolved_alias)
  full_comments = ["Alias for #{target.name}\n"]
  full_comments.concat(unresolved_alias.comments)
  full_comments << "\n"
  full_comments.concat(target.comments)

  super(
    unresolved_alias.new_name,
    unresolved_alias.file_path,
    unresolved_alias.location,
    full_comments,
  )

  @target = target
  @owner = T.let(unresolved_alias.owner, T.nilable(Entry::Namespace))
end

Instance Attribute Details

#ownerObject (readonly)

Returns the value of attribute owner.



529
530
531
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 529

def owner
  @owner
end

#targetObject (readonly)

Returns the value of attribute target.



526
527
528
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 526

def target
  @target
end

Instance Method Details

#decorated_parametersObject



555
556
557
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 555

def decorated_parameters
  @target.decorated_parameters
end

#formatted_signaturesObject



560
561
562
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 560

def formatted_signatures
  @target.formatted_signatures
end

#parametersObject



550
551
552
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 550

def parameters
  @target.parameters
end

#signaturesObject



565
566
567
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 565

def signatures
  @target.signatures
end