Class: Solargraph::Pin::MethodAlias

Inherits:
Method 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 Method

#node, #parameters

Attributes inherited from Base

#code_object, #location, #name, #return_type

Attributes included from Common

#closure, #location

Instance Method Summary collapse

Methods inherited from Method

#attribute?, #completion_item_kind, #documentation, #explicit?, #nearly?, #overloads, #parameter_names, #probe, #return_type, #symbol_kind, #try_merge!, #typify

Methods inherited from Closure

#binder, #context, #gates

Methods inherited from Base

#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #identity, #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, #text_documentation

Methods included from Common

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

Constructor Details

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

Returns a new instance of MethodAlias.



16
17
18
19
20
# File 'lib/solargraph/pin/method_alias.rb', line 16

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

Instance Attribute Details

#originalString (readonly)

Returns:

  • (String)


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

def original
  @original
end

#scope::Symbol (readonly)

Returns:

  • (::Symbol)


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

def scope
  @scope
end

Instance Method Details

#pathObject



26
27
28
# File 'lib/solargraph/pin/method_alias.rb', line 26

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

#visibilityObject



22
23
24
# File 'lib/solargraph/pin/method_alias.rb', line 22

def visibility
  :public
end