Class: Solargraph::Pin::MethodAlias

Inherits:
BaseMethod show all
Defined in:
lib/solargraph/pin/method_alias.rb

Overview

Use this class to track method aliases for later remapping. Common examples that defer mapping are aliases for superclass methods or methods from included modules.

Instance Attribute Summary collapse

Attributes inherited from Base

#code_object, #location, #name, #return_type

Attributes included from Common

#closure, #location

Instance Method Summary collapse

Methods inherited from BaseMethod

#parameter_names, #parameters, #return_type, #typify

Methods inherited from Closure

#binder, #context

Methods inherited from Base

#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #symbol_kind, #to_s, #try_merge!, #typify, #variable?

Methods included from Documenting

#documentation

Methods included from Conversions

#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help

Methods included from Common

#binder, #comments, #context, #name, #namespace, #return_type

Constructor Details

#initialize(scope: :instance, original: nil, **splat) ⇒ MethodAlias


14
15
16
17
18
# File 'lib/solargraph/pin/method_alias.rb', line 14

def initialize scope: :instance, original: nil, **splat
  super(splat)
  @scope = scope
  @original = original
end

Instance Attribute Details

#originalString (readonly)


12
13
14
# File 'lib/solargraph/pin/method_alias.rb', line 12

def original
  @original
end

#scope::Symbol (readonly)


9
10
11
# File 'lib/solargraph/pin/method_alias.rb', line 9

def scope
  @scope
end

Instance Method Details

#kindObject


20
21
22
# File 'lib/solargraph/pin/method_alias.rb', line 20

def kind
  Pin::METHOD_ALIAS
end

#pathObject


28
29
30
# File 'lib/solargraph/pin/method_alias.rb', line 28

def path
  @path ||= namespace + (scope == :instance ? '#' : '.') + name
end

#visibilityObject


24
25
26
# File 'lib/solargraph/pin/method_alias.rb', line 24

def visibility
  :public
end